Is pretending to be a soldier illegal? It is for pretending to be a policeman on official business. That makes sense.
How about a doctor? A man was arrested for rape in Israel for pretending to be a neurosurgeon and got a woman to go to bed with him.
How about an air marshall? On Delta, a woman pretended to be a reporter and a man pretended to be an air marshall. The man was arrested.
How about people, sometimes airline seatmates, claiming to be consultants?