Hi. Thank you for your question and reaching out.
Your firewall may block the connection.
If the Remote Desktop Service uses port 3389 by default, the session host must be reachable from the end-user devices for internal connections or from the Remote Desktop Gateway for external connections.
Verify that no firewall, including Windows Defender Firewall if it is turned on on the session host, is blocking the port that your RDS environment utilizes between the client and the session host.
Another possibility is a certificate issue. Because it employs SSL encryption, Remote Desktop Gateway needs a certificate to be installed. In order to ensure a successful connection with the session hosts, clients must have confidence in the certificate authority that issued the certificate.
Verify that a copy of the root certificate for the certificate authority has been imported into the Trusted Root Certification Authorities store by opening the Certificates Microsoft Management Console (MMC) on the client device.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.