Check AutoDiff return code (#4058)