In my experience it's a 50/50 change they'll give you access to sleep the night. It'll pop up over their head saying "Offers for you to sleep the night". My recommendation is to ask at least a couple times or spread the idea out between two messages or something. I find it 's more likely the game will recognize that you're allowed to sleep there if you warm them up to it first. Generally the spottiness of getting items from NPCs is a bit of a problem, but can be made a little more likely if you really "play things up" with NPCs. I have definitely noticed it's far harder to get items from NPCs in these more recent versions, unfortunately that's all the advice I can give.