Apart from the mentioned causes the printer in error state also occurs due to the corrupted device driver, when it doesn't have system permission, and sometimes due to the software confliction.
And the solutions to fix this error are relatively easy:
Check the connection of the printer
Update Windows OS
Run Printer troubleshooter
Update system device drivers