(Posting this in case it might help someone in the future).
When an SO import job was run, it worked fine, but when clicking the "Test" button the above error message caused everything to fail.
Cause: SO# 0000000 existed in SO history.
Deleting the 0000000 record in SO_SalesOrderHistoryHeader corrected the problem.