Is it possible that B'Elanna was a pretend Chief Engineer, a stuffed shirt? Sure she made the decisions and looked after the engines, but if Carey did 90 percent of the paperwork, it's not like she needed the rank to get things done.
O'Brien was the tactical Officer on the Rutledge, despite not having a commission.
Sometimes titles give powers that do no reflect rank.
Other times title create expectations that are not backed up rank.
Despite the Doctor's prancing, he is a soulless light bulb, the real CMO was his nurse.
First Kes, then Tom.
Either one of them briefly had a narrow window within which they could order Kathryn to do almost anything as long as it was with in a medical remit.