Bobb'e J. Thompson -- known for playing the foul-mouthed, trouble-making kid in "Role Models" -- is in some real-life trouble ... for allegedly having a stolen gun.
Law enforcement sources tell TMZ ... the actor was going through security at LAX when a Glock firearm was found in his baggage. We're told the gun was loaded too, but did not have a round in the chamber.
Our sources say during the airport police investigation, cops learned the gun was stolen ... and Bobb'e was arrested and taken to the station.
According to police ... Thompson -- also known for roles on "That's So Raven," "30 Rock" and 'House of Payne' -- was booked for felony possession of a stolen firearm.
He was released after posting a $35,000 bond.
We don't imagine he called any of the officers Ben Affleck. Funny as hell in the movie, but not so much when you're getting arrested.