Can't turn off the phone

Something strange happened tonight.
I logged out of a game and put the phone in sleep mode I think it's called?
2 seconds after, wanting to read a text, I couldn't swipe my finger across the screen on the standby screen!
I tried to turn the phone off, but I couldn't swipe my finger on the red square screen either!

I let the phone aside for 10 minutes and it worked, but can anybody tell me what happened?

Ty!
Seems like it just got confused and froze up. It happens from time to time when it gets conflicted.
happens to me about once every couple months. I just hold down the power and home button at the same time untill it restarts, because im impatient
Pug it to you computer and open itunes it should act right then.
happens to me about once every couple months. I just hold down the power and home button at the same time untill it restarts, because im impatient

This is what I do when I have wacky problems too.

Original thread: https://forums.imore.com/threads/cant-turn-off-the-phone.190518/