@mikefinch87@gmail.com I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to "Accept" the answer.
Issue:
You have an application Gateway fronting two function apps, each with a separate host name. One you can access but the other generates a 504 Timeout every time.
Solution:
You found the root Cause of the issue that you were hitting an http endpoint with only an https listener.
I will pass your feedback internally to the team.
Thank you again for your time and patience throughout this issue.