Check the case of both parts. مَا keeps its noun nominative, makes its predicate accusative in the plain pattern, and requires a genitive form after بِ.
Incorrect
Correct
Reason
مَا الْوَلَدُ مُجْتَهِدٌ
مَا الْوَلَدُ مُجْتَهِدًا
the plain predicate must be accusative
مَا الْبِنْتَيْنِ صَادِقَتَيْنِ
مَا الْبِنْتَانِ صَادِقَتَيْنِ
the noun of مَا remains nominative
مَا هُمْ بِمُؤْمِنُونَ
مَا هُمْ بِمُؤْمِنِينَ
the word after بِ must be genitive