Hello,
If you are sure that your gateway is functioning properly, you should verify the connection between your domain controller and the gateway. Additionally, if a gateway is in use, you will need to authenticate twice, once for the gateway and once for the terminal server.
If the Answer is helpful, please click "Accept Answer" and upvote it.