It seems like this is a known issue where the private endpoint configuration does not take effect until explicitly stop and start the Postgres flexible server.
You can try stopping and starting the Postgres flexible server and then test the connection again. If the issue persists, you can check the firewall rules and make sure that they are configured correctly to allow traffic from the private endpoint.
Let me know if you have any other questions