Press Win + R, type services.msc, and press Enter.
Find Print Spooler, right-click it and select Restart.
Try printing again.
If the same error appears, stop the Print Spooler, delete the files in C:\Windows\System32\spool\PRINTERS, then start the service again and test printing.