In my experience, this is not related to just custom actions; counts aren’t very stable in general. I have some ideas why this might happen, but this can’t be fixed from maker’s side.
Two workarounds which I use sometimes:
If this screen also has a list of same items (filtered), counts for same items/filters usually work better;
I add the helper property to Users collection, and store the value for this filtered count there.
What would be the filters? Includes m2m relations? I think the custom action fires up before Adalo process the count with filters and if I remember correctly, there were few cards in the board regarding issues with counts, I’ll note this one! I normally go with the second point which Victor mentioned, or pull-out the value using an input default value.