You don’t have to be on the same wifi, but it wouldn’t surprise me if McDonalds has a firewall or port blocking in place that prevents connection. You could try connecting to the cameras at the same location but with your phone’s cellular data connection (turn off wifi). If that works, it’s a good bet that McDonalds’ internet is the problem.
Libraries tend to be more open with their internet. While I haven’t tried accessing my Wyze cams there, I did access my Foscams a few months back without any issue.