I had that problem the other day. The sim went into offline mode and the Marketplace was inaccessible. (Only time that’s ever happened.)
I restarted the sim and everything was fine again. I have a 1Gb fiber internet connection and a good WiFi 6 router. Service outages are pretty much nonexistent. I think maybe the server connection was interrupted somewhere in the vastness of the internet. No way to know.
I’d definitely look at your ISP and your router setup if that’s a persistent problem for you.