It may fix itself if you save and load, but if it doesn’t, save editing should work:
NPC is bugged because it has two different z-level positions set in different parts of the save.
To fix it, you have to localize the NPC in your save. Note the name of your NPC. In your world’s directory, you have big files with names like o.0.0.sav. Search those for the name of your NPC (it can have spaces/newlines in the middle, so search just for the name, the nickname or the surname).
Once you find the NPC, search for “posz”. Change the number after it (probably 0) to the actual z-level the NPC is on. Save the file and load it in the game.