The problem may not be in the switch. Recessed lights have a temperature element inside that will shut them off when the temperature becomes too high. Replace your dimmer with a regular switch and see if the problem has gone away. If not, then the problem is in the lights. There may be material packed too close to the lights preventing proper air circulation. There are only two wires on the switch so it isn't difficult to check. Just turn the breaker off before you replace the switch.