Hello MARIA RIBEIRO,
Go to Event viewer > Application and Services Logs\Microsoft\Windows\TerminalServices-Gateway\Operational in the event viewer to find more details on the failure. Refer to the following for more details on the event ids (201/301/etc.) TS Gateway Server Connections | Microsoft Docs
On the Remote Desktop Gateway server, open Gateway Manager. Check if the RAP & CAP policies are configured correctly.
RD CAPs specify who is authorized to connect to RD Gateway. RD RAPs specify the network resources, such as remote desktops or remote apps, that the user is allowed to connect to through the RD Gateway. RD RAPs also authorize access to resources such as RD Session Hosts and RD Connection Brokers.
On the Gateway server check if the 'Network Policy Server' is registered in Active Directory
If the Answer is helpful, please click "Accept Answer" and upvote it.