I wouldn't think it would take more than 15-20 minutes to produce a video like that on your system. Maybe less than 10, so something is clearly going wrong - unless you're producing to HD or higher resolutions of H.265/HEVC or WMV - as your system doesn't have hardware encoding for those formats. You shouldn't have a crash though.
The first thing I'd suggest would be to update your video drivers for your nVidia 940MX with the version that was just released
today, and also to update your Intel HD 620 driver with the most recent
version from Dec 29 2022.
If you have trouble installing OEM drivers on your laptop, you'll have to stick with your current drivers as those are the most recent ones shown on your device's support
page from Lenovo.
I also see plenty of system craashes at teh end of your report, and often those are caused by problems with your Windows installation. Please try running Lenovo's Easy
troubleshooter and see what it can find.
You can also run the two commands shown in bold
here to manually run a diagnostic.
You also may want to use the Profile Analyzer and see if it can suggest an ideal output format to speed things up.