He broke the treaty of Algernon and the Prime Directive in Nightingale
A more alert captain would have busted him down to the enlisted ranks.
I don't believe he was acting as a Starfleet office in that case. He was just getting them to their destination. Prime directive wouldnt really apply
He's always a Starfleet officer. Getting these folks home seemed okay. Then it turned out that they were "gunrunners" trying to bust through a blockade and reverse the direction of a wars all but immediately foregone conclusion.
Cloaks aren't weapons!
Bullshit, if I was invisible I could do anything to you and you could't stop me. Invisibility is a gamechanger, and Invisibility with a gun is a winning hand.
Starfleet's non interference policy (which may or may not be the prime directive) says that they cannot get involved in a war they don't already have a horse in.
Harry didn't just get involved a little, he delivered weapons that would prolong the war for YEARS leading to the deaths of further billions until the planet belonging to the other lot is about to fall to the oppression of an unstoppable invisible enemy.
How is that not altering the balance of power?
Those actions undertook by Ensign Kim would also make him responsible for several War crimes as yet uncommitted, and as I said earlier lead to a censure from the Romulans asking why Harry was fiddling with illegal technology he was not allowed to touch or acknowledge the existence of?