I am sorry to hear you are experiencing an issue with the Speed test.
May I suggest looking into the below article for troubleshooting and resoloving this:
The 504 error sounds like a temporary dashboard issue, are you able to try again now and post back if you are still getting the issue, with a screenshot?
If you look in the Firewall Events Log, do you see any blocked or challenged requests that correspond to when you tried to run the Speed test from Cloudflare Dashboard?
I am not sure the cause of this, but before moving to Cloudflare, was your Website working over HTTPS connection?
May I ask you to enter your domain name in the below tool check by using Cloudflare Diagnostics Center tool to check: