The rank of Miles O'Brien was not consistent during his appearance on the shows.
During the story progression of TNG and DS9, O'Brien wears black
silver-rimmed insignia, or lieutenant junior grade (TNG: "Encounter at
Farpoint"), lieutenant insignia ("Redemption, Part II", "Data's Day",
etc.), and then black gold-rimmed insignia (DS9: "Emissary"). Sergey
Rozhenko calls him a Chief Petty Officer in "Family" (TNG) but he had
been referred to in previous episodes as Lieutenant. Eventually,
O'Brien receives a distinct senior chief petty officer's insignia and
his rank is emphatically identified in "Hippocratic Oath" (DS9).
From Memory Alpha:
The character of Miles O'Brien, and the exact rank he held in Star
Trek, has a history of its own spanning the length of the character's
In thirteen years of the character's appearances, only in the last
four was his rank established to be presumably senior chief petty
officer (although this term was never directly used on screen).
Through various other stages of the character's development, O'Brien
was referred to as a crewman, a lieutenant, and various script notes
indicated he was a "warrant officer." The novelization of "Emissary"
indicated O'Brien held a rank known as "ensign junior grade".
The site then provides a detailed account of the ranks he held on the episodes he appeared; due to its lenght, I've not reported it here, and I encourage you to simply read it at the source.