Without knowing more about what this is for and how you'd expect it to react, to me it looks like it's doing exactly what you've asked.
The formula errors on the part in red below (because J17 is empty) which fires the IFERROR part of the formula.
If you use the evaluate formula option it steps through like this:
Which ultimately gives the result:
What result were you expecting?