As I recall, the first time I was written up for a violation of the UCMJ was for forcing a safeguard. We had kicked out the LCM8 landing craft from the well deck when we entered Karachi to replace all the wood in the well deck. After a month of replacement and other stuff we left Karachi and headed into the north Arabian Sea and the LCM8's followed us down the river and reentered the ship off the coast. One of the necessary things following all of that was to test the zinc chromate levels in the engines. My sailors found that the Deck Department had placed locks on the engine rooms preventing access and so couldn't perform the preventive maintenance checks that were called for. When they asked me for assistance I sent one of them to the Deck office to ask for the locks to be removed. He came back and said they refused. As a result my Chief and I cut the locks off with some bolt cutters we just happened to have in the boat shop. I was charged with a Mast offense for doing it. As the ship's legal officer I found it somewhat novel to prefer charges against myself but I got to experience it about 4 more times before it all ended. Turns out, on that ship, under that Commanding Officer, no officer could be charged with forcing a safeguard when some other entity locked him out out his spaces and those 8 boat engine rooms were my spaces.
brought to mind by this bar owner charged with trespassing in his own bar after the canadian police changed the locks on his bar.https://fee.org/articles/canadian-restaurant-owner-charged-with-trespassing-after-reopening-in-defiance-of-lockdown-orders/