Where to measure ambient temperature limit inside of an enclosre?
Just thinking out loud without expert knowledge --

I guess this depends on the distribution of heat generation in the enclosure. If a single component generates much heat, you will have large heat gradients and the geometry of the device and thermal conductivity of the parts should be considered. If there instead are many small heat sources, I expect small temperature differences within the box making the measurement location largely irrelevant. A thermal camera or power consumption analysis should answer this quickly.

Secondly; I doubt the temperature rating of the contactor is that precise. Just the rough difference between +40 C and +60 C specification depending on enclosure hints that the manufacturer could have maybe a +- 10 C number in mind. If so, the exact location of measurement is also less important.

Finally, you have the interesting problem of deciding what to do if the temperature exceeds specification. If the measurement is just to test your general solution, just measure everywhere on your evaluation devices. If final usage is outdoors I suppose you do need a overheating warning and shutdown mechanism.