You should be able to disconnect using Apple script.
Also, I think there is a possibility to toggle WiFi on/off in the BTT actions, but I'm not sure about it.
use framework "CoreWLan"
current application's CWWiFiClient's ¬
sharedWiFiClient()'s ¬
interface()'s disassociate()
use framework "CoreWLan"
tell the current application's CWWiFiClient's ¬
sharedWiFiClient()'s interface() to ¬
setPower:(not powerOn()) |error|:(missing value)
The use framework "CoreWLan"-solution stopped working after I upgraded my Mac from an Intel to a M2 (don't know why). Replaced it with this which seems to do the trick:
set wifiStatus to do shell script "networksetup -getairportpower en0 | awk '{print $NF}'"
if wifiStatus = "On" then
do shell script "networksetup -setairportpower en0 off"
else
do shell script "networksetup -setairportpower en0 on"
end if