Actually had something Similar occur recently with an M1 Mac Mini (16GB-512GB). Was demoing the new Verizon 5G wireless service (it's OKAY, but comes nowhere near my 1GB Fiber service) and messing around with the wi-fi settings. Not sure exactly what I changed, but from a certain point forward NO amount of messing with things could restore my wi-fi. (Running the latest Mac OS Ventura 13.0 by the way). Even tried a fresh install of System Software.
As you noted. It was VERY strange. Both my internet services showed up via the Wi-Fi control panel. Was able to choose and join them, but could NEVER access any network with them. (Internet-Email-Game Servers, nothing).
BTW, Ethernet service was not affected and when connected directly to the router all was well.
Finally decided to try a Time Machine backup to a time that I knew everything was still working.
LUCKILY, and this was a major time saver, there is an option in the restore process that allows you to just restore
system and network settings. Once I did that restore, picked a full DAY before things went sideways, everything went back to normal. I'm hoping you have a backup somewhere.
STILL not sure what I did to cause it, and I doubt I could replicate it if I tried, but that solution seemed to work for me.
Something IS very buggy though. If I did that through normal system settings by accident, I think it may be indicative of a problem somewhere. Especially the leaps I had to take to recover.
Hope any of this helps. And if you do have a TM backup and it's successful, let me know if it works.
I'm curious as well.
WRC
ADDED: I ran the wireless diagnostic as well, and it could find nothing of use. The only thing it kept sugessting was a router re-boot, which I did try at least once, but as all of my other Apple and Non-Apple devices continued to connect and work I quickly ruled out the routers as a problem.