While working around with pdfkit on a combination of tech stacks, I found this in the logs:
File "env/lib/python3.11/site-packages/pdfkit/pdfkit.py", line 155, in handle_error
raise IOError('wkhtmltopdf reported an error:\n' + stderr)
Somehow, the actual error from wkhtmltopdf is not printed but rather it literally prints "stderr".