Create PDF from website using MS Edge

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --headless --print-to-pdf=c:\temp\google.pdf https://google.com/

This is crashing on my computer, but it’s still generating the PDF, so I’m not sure what the deal is there.