I managed to upgrade to Moodle 3.8.2 and it works ok that functionality, much easier to do things.... And in Moodle 3.8.2 the search works just fine, it won't show anymore the courses that are not supposed to be seen anymore, just the courses from the categories where an user is assigned to. Yay.
Courses and course formats
Hide course categories/courses from certain users
This discussion has been locked so you can no longer reply to it.