There is no easy way to duplicate this glitch as it just randomly happens.
No, it will randomly crash. In 1.15 you would sometimes open your inventory and get a blank white inventory UI, then it will close with 'error code 1'. Now whenever this happens its a guaranteed crash, and when you open your inventory or chest, it around a 10% chance for the game to crash..
The latest version seems to have fixed this but i’m unsure. It can be recreated by opening a chest and getting someone to kill you.