“Bellatrix tortured Neville’s parents into insanity and his boggart was still Snape.”

Ron’s sister was nearly killed by Voldemort and his boggart was still a spider. Hermione was nearly killed by Voldemort and her boggart was still failure (in the form of McGonagall). Harry’s parents were killed by Voldemort and Voldemort was constantly trying to kill him but his boggart was still a dementor. It’s clear that boggart fears aren’t rational. Furthermore, the whole class laughs after Neville says Snape is his worst fear and Neville grins along with them. Neville also says that he doesn’t want the boggart to turn into his grandmother either. The fact that Neville says that the boggart could also turn into his grandmother implies that his fears go deeper than Snape himself. He comes from a family where his uncle threw him out the window to prove he wasn’t a Squib. His grandmother is harsh on him because she wants him to live up to his parents’ legacy. When Neville says that the boggart could turn into Snape or his grandmother it seems like he fears harsh authority figures and not being seen as good enough more than Snape himself. Recency bias also plays a part; Snape had just been in the room and had threatened to poison Neville’s toad the prior lesson. Had the DADA class taken place right after McGonagall forced Neville to sleep in the hallway with an alleged mass murderer on the loose inside the school Neville’s boggart would have likely turned into McGonagall. Finally, the fact that boggarts often turn into something far less sinister than what the person has actually encountered implies that they show the person what they fear the most in the moment rather than their actual worst fear. It’s clear that Neville putting Snape in his grandma’s clothes was intended to be comic relief and to contrast his normal fear of a mean teacher with Harry’s unusual fear of dementors due to his trauma.