In مَا الْوَلَدُ بِمُجْتَهِدٍ, بِمُجْتَهِدٍ still functions as the predicate of مَا.

Negating Nominal Sentences with مَا