When they are bonded to hydrogen thatthat is $\ce{HOCN}$ $\ce{HNCO}$. The two compounds will be different .:
From
From Wikipedia
Organic cyanates are called isocyanates when there is a C−NCO$\ce{C−NCO}$ bond and cyanates when there is a C−OCN$\ce{C−OCN}$ bond.
Due to resonance after deprotonation the two anions will be the same.