I have the same issue on my Samsung Galaxy A11, and just tried fixing my phone in safe mode. This issue persisted even in safe mode. Each time you press the power button it immediately goes to the lock screen, but if it's plugged in it will turn off normally.