Can baked savory pastries with ham or bacon be left at room temperature?
That would depend on the source of the meats and the proportion of fat. Bacon I would advise against keeping at room temperature for 24 hours. Been there, done that, and it wasn't pretty.

I regularly take the chance on ham, but I am picky about safety, so I am picky about my meats. One encounter with antibiotic-resistant e-coli (from a restaurant) was enough to teach me that pickiness is much more favorable than a failure in food safety. 

The only way I keep ham at room temperature for 24 hours is if it is a) very lean, with all possible fat trimmed before it is finished cooking, and b) if purchased from a supermarket, gently boiled for two hours before use, even if it is being cooked again. This is assuming that you used a large ham of 11 lbs/5 kg or larger; reduce boiling time for smaller hams. I never, ever use a toupee ham, because one never knows whether meat glue is used in it, and in my experience, a ham with meat glue in it does not last as well as a whole ham.