I can confirm that this is happening on 1.17.1. Minecraft Java just hang in the UI (unable to open chest, etc.) but can still walk around. Trying to save and quit the game will just get the game stuck in the Saving screen. Had to terminate the Java process to get out. Happened every single time I unlock the next level for the cartographer (using the glass pane trade to level up the villager). Was in skyblock
Ah... you are right... It was Optifine. Using vanilla 1.17.1 I was able to level up the cartographer just fine... weird 🙂 Thanks.