I’ve had the same problem with a paper2d project upgraded from 4.26 to 5.3.2, both built from source.
In my case it seems to be down to a node “set scalar parameter value” being updated through a timeline. If I update it manually then it’s fine, but if I use the timeline to update the value then it causes the crash on exit.
I suspect it’s something to do with garbage collecting on exit as the material reference is corrupted.