Couchbase UI and N1QL query both show incorrect document count

We have couch 5.1.0 single node couch, where we were testing incremental data load.
After one run Couchbase UI showed 135 more docs than expected.
N1QL query run from UI too showed same count.
Document count was not fixed automatically even after long time.
We had seen this issue before, then somehow couchbase vm was restarted and we got expected count.
This time I changed ejection method to full ejection, and then doc count decreased to whatever we expected.
It seems reloading bucket caused the correction to happen.
Can someone explain this ?
Is there a better way to fix this issue ?