Buzz Lightyear was always a dimwitted character throughout the first three Toy Story movies, there's always something wrong with him where he thinks he's a real Space Ranger for most of it.
In Toy Story : Buzz himself is deluded and thinks he's a Space Ranger until he saw a television commercial about himself at Sid's house.
In Toy Story 2 : It's a different Buzz Lightyear with a blue utility belt from Al's Toy Barn that's deluded like the one that belongs to Andy in the original film
In Toy Story 3 : Andy's Buzz is deluded again but this time he's brainwashed by Lotso as a bodyguard to hold his friends hostage at Sunnyside Daycare and when Woody and the gang try to switch him back, they accidentally switched him to Spanish mode.
In Toy Story 4 : The inner voice is causing Buzz to act like this
So why are you guys just now noticing him act like an idiot when this is how he's always been ?