When you have a question about whether to use the definite or indefinite article, here are a couple of general guidelines about the difference:
- Using "a"/"an" means basically "there may be more than one, and if there is, it doesn't matter which one you choose"
- Using "the" means "there is a specific one that's important here, and other ones may not be the same"
So in this case, saying "Check that a returned status is STATUS_FAILED" means "you can have a bunch of returned statuses, but you just need to make sure that one of them (it doesn't matter which one) is STATUS_FAILED (and the others don't matter)", which is not really what you mean to say, I think.
Since the prior step was to make a (specific) call to the function, you probably want to check the (specific) returned status from that particular call. Therefore, you want the definite article to show that you mean a particular one, not just any old one:
Check that the returned status is STATUS_FAILED
Which means "It doesn't matter whether there are other returned statuses (maybe from other calls to the function that happened before, or with different parameters), you should check that the particular returned status from the specific function call we're talking about is STATUS_FAILED"