HP ‘protect’ their cartridges by writing a code to the chip embedded in the cartridge - when you install a new cartridge in the printer it writes a code locking it to that printer - so if you put it in a different printer that uses the same cartridge type it won’t work.

 

Happily if the printer is a network printer you can go to its web page interface, select settings/cartridge protection/disable - you should then be able to use any compatible cartridge.

 

If you are using a USB connection you can still disable “cartridge protection” via the menu settings.