“disconnecting after a few seconds” means it doesn’t work to begin with. Plex takes an “optimistic approach” and shows a green status while testing the connection.
Step 1:
If your server is older than 3 months, take a look at your server logs to verify if there’s any references of a stuck certificate.
e.g. CERT: Error acquiring new certificate: Failed to upload CSR: 429 message="API rate limit exceeded"
Step 2:
Even if you didn’t change anything, there could have been some changes to your remote access setup (e.g. changes by your ISP).