Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Check that your query is returning the FinalStatusCode column correctly and that the values are valid. You can do this by running the query and confirming that FinalStatusCode shows up in the results.
print Summary="2 Errors", FinalStatusCode=2
Make sure your query is showing the correct FinalStatusCode results. You can also use the project operator to select FinalStatusCode directly in your query.
print Summary="2 Errors", FinalStatusCode=2
| project FinalStatusCode
you have any further queries, do let us know.
If the answer is helpful, please click "Upvote it".