My friends son was like this - he whined at me VERY LOUDLY when we were shopping at age 5, and I put him in time out at my house until he was ready to apologize. He seriously sat there for 3 hours. Sure, he got up a few times (a lot of times) and asked if he could get out of timeout, but each time I asked if he was sorry yet and each time he said no, so I told him his time out had to continue. Finally at about the 3 hour mark he apologized. I don’t know if he was actually sorry or if he finally realized I wasn’t messing around and he had to lie - lol. I still can’t believe he actually sat there that long. But… Guess who stopped being whiney with me after that weekend? He’s 14 now and hasn’t done it since to me. Not a single time.
That being said, he behaved like that for his parents all the time… it was constant back and forth every time we’re out there visiting. He has been less whiney the past few times we saw him… so maybe he grew out of it? I don’t know.