I think that the BP garage you mentioned, and the one at the other (Inveralmond) end of Dunkeld Road, and the Esso next to the Tesco on Edinburgh Rd (leaving town in Bridge or Earn direction) are all 24 hour but likely to be hatch service in the wee hours.
I don’t think any of the big supermarkets are open 24 hours at the moment.
There aren’t any hidden back street greasy spoons staying open all night for taxi drivers (or other participants in the night time economy) or anything like that I can think of - just places that open early for workies picking up bacon rolls, or kebab shops etc. that might still be open past midnight on a Friday.
So yes, I think Broxden’s your best bet. I don’t know for sure if the shop at the filling station (used to be a Spar, is now a Budgens) will be open to walk in, but I would have thought so.
Google reckons that although the Dunkeld Rd McDonald’s is closed overnight, the Broxden one is open 24 hours, and McDonald’s own website agrees.