outputErrors

Use it to output a native Google Sheets #ERROR! message when an error occurs.

By default the function returns custom messages when an error occurs (such as #FILTER_NOT_VALID). Those messages are not recognized by Google Sheets as proper errors. Therefore you cannot use the ISERROR or IFERROR functions.

=IMPORTJSON(data_sources, filters, "outputErrors")

or

AB
1outputErrorsTRUE
3=IMPORTJSON(data_sources, filters, A1:B1)