For me, the "RefreshAllDataConnections()" method is only executing when I have the workbook open in the desktop Excel client. It doesn't work when I test it from a browser or PowerAutomate.
To properly test it I got the script to write "Hello World" in a specific cell after attempting to refresh the data. This text appears correctly in every test scenario, even when the data hasn't refreshed in the line of code immediately above it.
I also tried leaving a 15 second delay in my Power Automate cloud flow between a "refresh" action and a "Hello World" action. Same issue.
I suspect that the RefreshAllDataConnections() method is currently only supported in the desktop client, which is a real shame.