On Commons NS_MAIN is used for gallery pages, which are user-curated collections of images ... essentially hand-curated search results which are very often not well-maintained
Categories tend to be maintained better than galleries, but searching tends to return galleries higher in the results than categories (probably because gallery pages are likely to contain more matching text)
We have a community wish to change this https://meta.wikimedia.org/wiki/Community_Wishlist/Wishes/When_searching_Commons,_under_%22Categories_and_Pages%22_show_the_category_for_the_search_term
A possible way to do this would be to change the weights for galleries in CirrusSearchNamespaceWeights, e.g.
'wgCirrusSearchNamespaceWeights' => [ 'commonswiki' => [ 1 => 0.9, ],