When you get set on fire, the fire effect usually stays facing the screen, but not if you open inventory as it will only be visible when facing south, because it doesn't match rotation inside the inventory of the player.
To replicate this, set yourself on fire with lava or the fire block, then open your inventory and see that it will only face south, not matching the correct rotation of the player.
Does MC-172398 describe your issue?