Given the executor state, asserts that no invariant has been broken. Otherwise, it fills the
external invariant_failures.failed_invariant map and returns a generic error.
Either returns the call result if successful, or nothing if there was an error.