I haven't seen mine lose Internet entirely, but I have seen it randomly switch between the two Wi-Fi networks I have set up where I live. I eventually got frustrated with this and then told it it can't automatically connect to one of them anymore.
Likely that it is related to Bluetooth as well. Especially if you have AirPods connected. I noticed the wireless connection quality degrades significantly when the device is connected to an AirPod.
Have you tried flushing the DNS cache?
This has almost become a meme at this point. Anyone in the office who has a problem with their internet on the Macbook, I just send them this: