Imagine your file to be split into two parts. The good, and the bad. A NSF right before close is bad. It alone is enough to make an UW deny you, but not usually. BUT, if your file already has plenty of bad stuff (recent lates, high DTI, borderline FICO...etc) then the NSF could be the last straw. If you have a fairly clean file you should be OK. Also, different UW can be different. The investor buying the loans may be as well. The investor may have a stipulation for things like no overdrafts/nsf in past 30 days, etc.
So, generally, if the file is clean an NSF is no big deal. If a file is so/so you will probably be OK. If the file is weak, you may have a big problem..
It can also matter what the NSF was and what spending patterns they see around it. IN general though, it is more a pattern of NSF that will get you booted, not a single one.