Hello 0xbb,
Thanks for posting in Apple Support Communities.
This is definitely a strange occurrence. The following steps may be able to assist you with resolving this Wi-Fi issue:
"Restart your Mac
Restarting might help because your Mac then automatically renews the internet address it was assigned when joining the Wi-Fi network. Or you can renew the IP address manually. This is known as renewing the DHCP lease. If the lease expired and the address is already in use by another device, your Mac is assigned a new address.
Update your Mac
Update the software on your Mac, and make sure that the date and time are set correctly.
Use the built-in diagnostic tools
Wi-Fi Recommendations. Click Wi-Fi
in Control Center or the menu bar and check for a menu item named Wi-Fi Recommendations. If you see it, your Mac has detected an issue and has recommendations. Choose Wi-Fi Recommendations to learn more.*
Wireless Diagnostics. Press and hold the Option key on your keyboard while clicking Wi-Fi
in Control Center or the menu bar, then choose Open Wireless Diagnostics from the menu. Learn more about using Wireless Diagnostics to analyze your wireless environment.

Update the Wi-Fi router
If you manage the network's Wi-Fi router, install the latest firmware updates for the router, as recommended by its manufacturer. It might also help to simply restart the router and use Apple's recommended settings for Wi-Fi routers and access points."
More details here: If your Mac isn't connecting to the internet over Wi-Fi
We hope this helps.
Cheers.