The hill I will die on is that Snape has a volatile reaction to other people being in physical, especially mortal danger, and it's one of the many understandable reasons he comes off as abrasive towards the Trio and Neville. We see repeatedly that Severus reacts strongly to it, and can act impulsively in such situations.
Severus most often lashes out at Harry when Harry puts himself and/or others in danger – using Arthur's car to fly to school, running away to Hogsmeade while dementors and an alleged murderer are around, being found in a Shack with Black and about to transform into a werewolf Remus, showing up on the first of September late and with a bloodied face, firing Sectumsempra at Draco, etc. Even with the pensive situation, when Severus has a different reason to be really upset, he initially leaves Harry alone with his most private memories because his missing student had been found, AND we don't know what kind of memories Harry might've seen after SWM if Severus didn't drag him out before it's finished.
Severus has a problem with Neville as a student, who is genuinely a physical danger to himself and everyone around him, both with his potions and his spells – even though it's not his fault, of course. It's clear that that he does not want Neville to end up harmed.
Severus calls Hermione an insufferable know it all – in contrast to him just telling her to sit down or stop showing off elsewhere in the books – during the werewolf class, where he tries to warn students about the danger Remus poses to them.
We see Severus running up the corridor at night because he heard a scream; he shows a similar reaction when he hears Trelawney loudly crying, and when Myrtle shouts "murder". I also think that him being shown to patrol corridors at night more than other teachers (“You asked me to come directly to you, Professor, if anyone was wandering around at night...") has to do with him being worried for their safety – see Fluffy, moving staircases, etc. We don't see Severus showing animosity towards students – and overall people – whom he doesn't see as dangerous to others (a casual reminder for anyone who might need it that Snape is not shown to be equally hostile towards all students or all gryffindors in Harry's group).
So it would make perfect fucking sense that in a highly dangerous environment such as Hogwarts, and during a highly dangerous subject such as Potions, he would rather those kids be upset than kill themselves and/or someone else. If you are characterising Severus in a fanfic, and thinking about how he'd react to something, then whether the situation is physically safe and whether the person has a pattern of causing deliberate harm/unintentional mayhem will definitely influence things for him emotionally.