Appropriate discipline onboard a starship

As I read it, the “sitting on the floor”-thing was in-game and not out-of-character.

That being said, my first reaction, too, was “Why didn’t the transporter disable the firearm?”. Maybe this will help the PCs in their defense.

In-universe, there should be at least some negative feedback (be it a Captain’s Mast, disciplinary action or a full-grown military tribunal). This also is a text-book-example for negative influences on reputation checks.

Out of game, I really recommend to check for player expectations. It doesn’t sound like all the players at the table are playing the same game. Maybe, the player of the security officer is not into playing a starfleet officer at all or at least has difficulties in adapting their play-style from a standard D&D chaotic-something rogue.

Or maybe, everyone actually does play the same game, but fails to communicate they do. Meaning: Maybe the player playing the security officer wants to display in-character struggles with authority and their own discipline. This has happend before, just look at Tom Paris in early Voyager, needing time and personal development to fit in. It would be detrimental to their expectations to just ignore it.

Please have a talk as a whole group, maybe advanced and/or followed by one-on-one talks where everyone clearly communicates their expectations. Playing should be fun for everyone.
For such a talk, maybe take into consideration the points that were raised in the Session 0 in STA thread right in this forum.