It's interesting, it somehow means you are agreeing with them if they don't have it, so they don't have to feel so bad about not having it.
"Do you not have bananas?" is like "is it true that there are no bananas?". Then if there are bananas, the host can gleefully surprise you with them and feel like they solved a problem for you. This is only if it's said in a constantly upwardly-shifting tone, though.
It can be said another way, same words different tone, which sounds more like "how perplexing, there's no bananas, let me just make sure I didn't miss them because I thought they should be here". The host usually backs their answer up with an explanation of why there are no bananas.
A third form exists where it does sound accusatory. Like "you should have bananas you piece of crap". Usually said in a huffy puffy I-dont-have-time-for-this tone.