I don't always fail to recognize people, but it can be a challenge.
And yes, meeting a neighbor in the stairwell makes it easier to recognize them than if I meet someone on the street or in a store and they say hi, then I'm often lost. If my mother is there I will ask her afterwards "whio was that?" and she will laugh and tell me it was this or that person, for instance the neighbor. But there are also people I recognize outside of where I know them, so I don't always draw blanks. But it's definitely easier to know who they are when they are where In expect them to be (like in the stairwell, in a store, in schoool when I was younger etc)