Hey there venkatvenky,
It sounds like this might be expected behavior. Check out the information and link below to help further:
iOS and iPadOS devices have built-in protections to prevent overheating. If the interior temperature of your device exceeds the normal operating range, your device will protect its internal components by attempting to regulate its temperature. Here are some of the higher ambient-temperature conditions and activities to avoid, because they might cause your device to change performance and behavior:
• Avoid leaving your device in a car on a hot day.
• Avoid leaving your device in direct sunlight for an extended period of time.
• Avoid using certain features in hot conditions or direct sunlight for an extended period of time, such as GPS tracking or navigation in a car, playing a graphics-intensive game, or using augmented-reality apps.
If the interior temperature of your device exceeds the normal operating range, you might notice these changes:
• Charging, including wireless charging, slows or stops.
• The display dims or goes black.
• Cellular radios enter a low-power state. The signal might weaken during this time.
• The camera flash is temporarily disabled.
• Performance slows with graphics-intensive or augmented-reality apps or features.
Additionally, if you're navigating, your device might show this alert and turn off the display: "Temperature: iPhone needs to cool down." Navigation still provides audible turn-by-turn directions. When approaching a turn, the display will illuminate to guide you through the turn.
If your iPhone, iPad, or iPod touch gets too hot or too cold - Apple Support
If you receive a temperature alert on screen or this happens under normal circumstances, Contact Apple Support for additional options.
Take care!