IWD on Asahi sometimes disconnects and cannot connect again for a few minutes

I am using IWD instead of Network Manager on Asahi and for the most part it works really well. However once in a while the wifi disconnects and when I try to connect I can’t. I actually see the network I want to connect to (using the dbus interface) but if I try to connect it fails with net.connman.iwd.NotFound error.

In the journalctl output I see this,

Jul 20 15:43:09 asahi iwd[876]: Received Deauthentication event, reason: 3, from_ap: false
Jul 20 15:43:09 asahi iwd[876]: event: disconnect-info, reason: 3
Jul 20 15:43:09 asahi iwd[876]: event: state, old: connected, new: disconnected
Jul 20 15:43:09 asahi iwd[876]: event: state, old: disconnected, new: autoconnect_quick
Jul 20 15:43:10 asahi iwd[876]: event: connect-info, ssid: SSID, bss: xx:xx:xx:xx:xx:xx, signal: -78, load: 1/255
Jul 20 15:43:10 asahi iwd[876]: event: state, old: autoconnect_quick, new: connecting (auto)
Jul 20 15:43:10 asahi iwd[876]: CMD_SET_CQM failed: Operation not supported
Jul 20 15:43:16 asahi iwd[876]: event: connect-failed, status: 16
Jul 20 15:43:16 asahi iwd[876]: event: state, old: connecting (auto), new: disconnected
Jul 20 15:43:16 asahi iwd[876]: event: state, old: disconnected, new: autoconnect_full
Jul 20 15:43:20 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e1
Jul 20 15:43:20 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e5
Jul 20 15:43:30 asahi iwd[876]: Received error during CMD_TRIGGER_SCAN: Invalid exchange (52)
Jul 20 15:43:50 asahi iwd[876]: Received error during CMD_TRIGGER_SCAN: Invalid exchange (52)
Jul 20 15:44:07 asahi iwd[876]: event: connect-info, ssid: SSID, bss: xx:xx:xx:xx:xx:xx, signal: -80, load: 1/255
Jul 20 15:44:07 asahi iwd[876]: event: state, old: autoconnect_full, new: connecting
Jul 20 15:44:07 asahi iwd[876]: CMD_SET_CQM failed: Operation not supported
Jul 20 15:44:08 asahi iwd[876]: event: connect-failed, status: 16
Jul 20 15:44:08 asahi iwd[876]: event: state, old: connecting, new: disconnected
Jul 20 15:44:08 asahi iwd[876]: event: state, old: disconnected, new: autoconnect_quick
Jul 20 15:44:08 asahi iwd[876]: event: state, old: autoconnect_quick, new: autoconnect_full
Jul 20 15:44:11 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e1
Jul 20 15:44:11 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e5
Jul 20 15:44:20 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e1
Jul 20 15:44:23 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e5
Jul 20 15:44:26 asahi iwd[876]: event: connect-info, ssid: SSID, bss: xx:xx:xx:xx:xx:xx, signal: -84, load: 1/255
Jul 20 15:44:26 asahi iwd[876]: event: state, old: autoconnect_full, new: connecting
Jul 20 15:44:26 asahi iwd[876]: CMD_SET_CQM failed: Operation not supported
Jul 20 15:44:34 asahi iwd[876]: event: connect-failed, status: 16
Jul 20 15:44:34 asahi iwd[876]: event: state, old: connecting, new: disconnected
Jul 20 15:44:34 asahi iwd[876]: event: state, old: disconnected, new: autoconnect_quick
Jul 20 15:44:35 asahi iwd[876]: event: state, old: autoconnect_quick, new: autoconnect_full
Jul 20 15:44:39 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e1
Jul 20 15:44:39 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e5
Jul 20 15:44:53 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e1
Jul 20 15:44:53 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e5
Jul 20 15:45:13 asahi iwd[876]: Received error during CMD_TRIGGER_SCAN: Invalid exchange (52)
Jul 20 15:45:31 asahi iwd[876]: event: connect-info, ssid: SSID, bss: xx:xx:xx:xx:xx:xx, signal: -85, load: 1/255
Jul 20 15:45:31 asahi iwd[876]: event: state, old: autoconnect_full, new: connecting
Jul 20 15:45:31 asahi iwd[876]: CMD_SET_CQM failed: Operation not supported
Jul 20 15:45:31 asahi iwd[876]: event: connect-failed, status: 16
Jul 20 15:45:31 asahi iwd[876]: event: state, old: connecting, new: disconnected
Jul 20 15:45:31 asahi iwd[876]: event: state, old: disconnected, new: autoconnect_quick
Jul 20 15:45:31 asahi iwd[876]: event: state, old: autoconnect_quick, new: autoconnect_full
Jul 20 15:45:31 asahi iwd[876]: Received error during CMD_TRIGGER_SCAN: Invalid exchange (52)
Jul 20 15:45:31 asahi iwd[876]: Received error during CMD_TRIGGER_SCAN: Invalid exchange (52)
Jul 20 15:45:38 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e1
Jul 20 15:45:42 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e5
Jul 20 15:45:44 asahi iwd[876]: event: connect-info, ssid: SSID, bss: xx:xx:xx:xx:xx:xx, signal: -86, load: 1/255
Jul 20 15:45:44 asahi iwd[876]: event: state, old: autoconnect_full, new: connecting
Jul 20 15:45:44 asahi iwd[876]: CMD_SET_CQM failed: Operation not supported
Jul 20 15:45:46 asahi iwd[876]: event: connect-failed, status: 16
Jul 20 15:45:46 asahi iwd[876]: event: state, old: connecting, new: disconnected
Jul 20 15:45:46 asahi iwd[876]: event: state, old: disconnected, new: autoconnect_quick
Jul 20 15:45:46 asahi iwd[876]: event: state, old: autoconnect_quick, new: autoconnect_full
Jul 20 15:45:46 asahi iwd[876]: Received error during CMD_TRIGGER_SCAN: Invalid exchange (52)
Jul 20 15:45:46 asahi iwd[876]: Received error during CMD_TRIGGER_SCAN: Invalid exchange (52)
Jul 20 15:46:01 asahi iwd[876]: invalid HE capabilities for 00:0f:15:46:da:e5
Jul 20 15:46:04 asahi iwd[876]: event: connect-info, ssid: SSID, bss: xx:xx:xx:xx:xx:xx, signal: -82, load: 1/255
Jul 20 15:46:04 asahi iwd[876]: event: state, old: autoconnect_full, new: connecting
Jul 20 15:46:04 asahi iwd[876]: CMD_SET_CQM failed: Operation not supported
Jul 20 15:46:08 asahi iwd[876]: event: state, old: connecting, new: connected

In the dmesg output I see this,

[78748.062617] ieee80211 phy0: brcmf_run_escan: error (-52)
[78748.062640] ieee80211 phy0: brcmf_cfg80211_scan: scan error (-52)
[78768.063180] ieee80211 phy0: brcmf_run_escan: error (-52)
[78768.063203] ieee80211 phy0: brcmf_cfg80211_scan: scan error (-52)
[78850.340378] ieee80211 phy0: brcmf_run_escan: error (-52)
[78850.340399] ieee80211 phy0: brcmf_cfg80211_scan: scan error (-52)
[78868.574932] ieee80211 phy0: brcmf_run_escan: error (-52)
[78868.574953] ieee80211 phy0: brcmf_cfg80211_scan: scan error (-52)
[78868.586409] ieee80211 phy0: brcmf_run_escan: error (-52)
[78868.586424] ieee80211 phy0: brcmf_cfg80211_scan: scan error (-52)
[78883.580831] ieee80211 phy0: brcmf_run_escan: error (-52)
[78883.580854] ieee80211 phy0: brcmf_cfg80211_scan: scan error (-52)
[78883.582730] ieee80211 phy0: brcmf_run_escan: error (-52)
[78883.582741] ieee80211 phy0: brcmf_cfg80211_scan: scan error (-52)

As can be seen the problem persists for a couple minutes and then corrects itself i.e. after a few attempts the connection happens. Any idea about how to resolve this? Or how to decrease the number of attempts required?