Mac gets very hot when locked and on battery power
Have you tried an SMC reset? System Management Controller "can resolve certain issues related to power, battery and other features." according to Apple's website.

There are different methods for resetting SMC, depending on your model. Here is a link to Apple's site with instructions for resetting SMC.

https://support.apple.com/en-us/HT201295