If you remove the cartridge and life the registration flap, (green handle right side) you will see a flag underneath. Use compressed air to blow it out as the sensor sometimes gets blocked with paper dust and then printer does not detect paper properly and throws an error. These sensors can also fail and are not replaceable. Does tray 1 work ok?
If you find the information provided useful or solves your problems, help other users find the solution easier by giving kudos and marking my post as an accepted solution. I am a volunteer, offering my knowledge to support fellow users, I do not work for HP nor speak for HP.
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".