A UDN reported various crashes at exit in the embedded Python library. I was able to repro the issue in Release-5.1 and trace it back at the point where python runs its garbage collection in Py_Finalize(). The bug is also random, sometimes it crashed, sometimes it didn't. I used a small init_unreal.py for QAGame (E:\UE_5.1\QAGame\Content\Python\init_unreal.py) that I attached with this bug.
Because the bug is random, I suspect a memory stomp or a race condition. It seems to happen when we alias unreal object in class members.
Crash group: [Link Removed]
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-168225 in the post.