The third-party ink cartridges will work. But there are many cartridges in the market which are refilled and sometimes the chip is not configured to work with the printer. You need to contact the cartridge manufacturer and find out why it's not working. Try a different cartridge supplier and check if that works.
I hope that answers your concern adequately. Let me know!
And, Welcome to the HP Support Community.
Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".