Are you recording directly to MP4? I know it's tempting, for immediate familiarity ("what's this MKV thing?"), but that's what MP4 does when you don't close it properly. Everything's gone. That's why the warnings not to do that.
MKV (Matroska), doesn't do that. If you crash without closing, it keeps what it has. And it doesn't take long to convert it at the end. No loss of quality, just a bitwise copy into a different container. OBS even has an option to do that automatically. Or you can do it manually as well, as the case may be if OBS crashes before it hits the automatic trigger. Just open it back up and "remux" the recording(s), as it's called.
That doesn't solve the crashing problem, but at least you get to keep what you have.
Also, YouTube and a lot of editors and players will take MKV directly, with no need to remux. Depending on what you're doing, you can probably just ignore that step and use the original file as-is.