Add asserts for bounds on diagnostics

I have encountered a couple of cases where the error spans have negative length. Adding asserts so that we can track down these cases.