I am having the same problem on an M1 macbook air. Macbook air running 11.4, iphone and ipad running 14.6. The Mac can't find either device over wifi.
1) I plug in iPhone, it pops up in finder
2) I check the "show this iphone when on wifi" box and press apply.
3) I unplug or dismount iphone (phone/ipad immediately disappears from finder)
4) I restart mac, neither device shows up over wifi
5) I plug in the devices using apple lightning/usb-c cables and the "Show this iPhone when on Wi-Fi" box is unchecked again.
6) I recheck the box and try again
...rinse and repeat x100
This behavior is the same for both my iphone 12 and ipad air 4 when trying to sync to the M1 MBA. I can sync all devices just fine using a wired connection. All devices are on the same wifi network. My 2017 Macbook Pro 13" (running and older version of MacOS) has absolutely no problem wifi syncing with the same iphone 12 and ipad air 4.
Troubleshooting so far:
1) I have reset everything there is to reset re network settings, device trust settings, and all other settings.
2) I have done a factory restore on all devices 2x. On the last restore, I did not restore any software from any backups, and I tried to sync the iphone and the mac first thing before manually loading any software or changing any settings. I didn't even sign into itunes initially!
3) I reset my wifi network. I even tried another wifi network.
I've spoken to multiple tech support people, and have a follow-up call next week, but so far nobody has any idea what's going on.
Pretty disappointed because this feature is the primary reason I switched to iPhone from Android, and Apple doesn't seem to have any solutions. I really have no interest in subscription music, so if they can't find a solution I'll just go back to android.