Add error checks to highstate per #16702

Fix #16702