Is this a serverless database? Serverless databases are unloaded from the server when they have been idle for a while. When they start up again, it can take some time, and you need some patience and multiple connection attempts.
Serverless is great for databases that are used infrequently, since unloading them keep the costs down. On the other hand, If they are up most of the time, a provisioned edition is a better choice. But I seem to recall that the free-tier is always Serverless.