I found the place it happens but not sure what is the right solution, (or maybe I’m wrong? pretty new here)
https://github.com/numenta/nupic/blob/master/src/nupic/research/spatial_pooler.py#L1471
maskNeighbors is just the index array of neighbors column.
numBigger is zero because there are no overlaps, but maskNeighbors size is bigger than zero because there are neighbors, making numActive bigger than zero in some cases, and that makes the column a winner column.
In the description it says, Each column observes the overlaps of its neighbors and is selected if its overlap score is within the top 'numActive' in its local neighborhood.
So I guess if the overlap score is 0 and all the neighbors got overlap score of 0, 0 is within the top neighbors overlap score, which makes the column active.
Edit: I edited it too much cause I found I was wrong too many times.