I had similar problem. You can try entering the building in stealth mode, that way all NPCs don't turn hostile. It worked for me, although I'm not sure which behavior is a bug, NPCs turning hostile when you reenter or them acting normal when you reenter in stealth mode.