To perform this bug quickly, press 'F3+N' to switch between modes and exit spectator mode while in the chest UI. You need to be in spectator mode, open the chest, and then switch the game mode to non-spectator. Doing this will reverse the chest animations.
Thank you for helping us improve Minecraft! We saved your files: