Is this the new error occurred after you upgraded to latest RDC for mac?
When checking the release of RDC for mac 10.4.1, it mentioned to address the 0x5000007 error message when connecting using an RD Gateway server.
Have you tried to remove and re-fillin the RD gateway info when start the remote connection?
If it used to work well with previous version, you may test by download similar Beta version as workround and report the new issue you met.
Microsoft Remote Desktop Beta
Hope this helps and please help to accept as Answer if the response is useful.