Your formula should work OK with a list of sheetnames, e.g. list all the worksheet names somewhere on the worksheet - name that list Sheetlist and use this version
=SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheetlist&"'!J5:J99");$J2))
Note: no quotes around Sheetlist
To accommodate the extra condition use COUNTIFS, e.g. with OK/Error etc. in column F
=SUMPRODUCT(COUNTIFS(INDIRECT("'"&Sheetlist&"'!J5:J99");$J2;INDIRECT("'"&Sheetlist&"'!F5:F99");K$1))
COUNTIFS
requires Excel 2007 or later - in Excel 2003 you can use this version
=SUM((T(INDIRECT("'"&Sheetlist&"'!J"&TRANSPOSE(ROW($5:$99))))=J$2)*(T(INDIRECT("'"&Sheetlist&"'!F"&TRANSPOSE(ROW($5:$99))))=K$1))
which is an "array formula" which needs to be confirmed with CTRL+SHIFT+ENTER