I had this happen as well while fighting Queen Slime - I got trapped in a hole and got killed by one of the crystal slimes a second after killing the Queen. I clearly saw the treasure bag drop, but after a couple seconds it completely disappeared. I was playing in multiplayer, version 1.4.0.4 on Windows 10