IMO this is exactly how it should work and what you’ve spotted is a weakness in the search functionality. My recommendation would be to continue tagging correctly (IMO addr:flats is better suited for this situation since it explicitly permits ranges and multiple values) and have faith that the search algorithms with catch up.

The openstreetmap.org search box is powered by a project called Nominatim. You could report an issue on Nominatim’s Github page, but it looks like there’s already a relevant discussion in issue 587.