A modern engine can handle extended idling with or without the AC on, but it is not good for an number of reasons:
Even though the coolant will get very hot, the oil in the sump will likely not get hot enough to drive off accumulated water, so this condition promotes oil sludging. This is part of the reason why extended idling is considered severe service
The underhood temps will get close to their design limit which means you will shorten the life of all of the plastic and rubber components and the car battery
idling is actually the worst-case for camshaft wear, though the engine should handle it if it is designed properly
wasted fuel. also see: Idling – Roth Automotive Science (https://rothautomotivescience.com/idling/)