You say guns...so I assume you are a Marine.
The short answer to the question "who can secure Marines
to the barracks" is the Battalion Commander
It is the battalion commander who has this authority. This comes from the authority to command. For the Marine Corps, you would find this in the Navy
Regulations (Chapter 8 to be specific). The commander has all power required to "accomplish the mission" and "take care of the troops"
Now...as I mentioned prior, that authority can be delegated. And often will be. For example, the staff duty officer
/NCO will have the power of the commander in the absence of the commander.
And it can be further delegated...often the battalion commander will delegate to his company commanders the power needed to accomplish the mission/ensure troop welfare.
So, to answer the question, did the gunny have the power to secure libbo for the 96?
Most likely no, not unless delegated by the battalion commander.
Repercussions? I expect that the battalion commander would reprimand the gunny for issuing an order outside his authority.