It seems like some validation is being triggered. I would confirm what fields you have for each table that are included. For the Purchase Lines (Table 39) you may want to include the Buy-from Vendor No. field and make sure that the lines include the exact same Buy-from Vendor No. as the header.
Or an alternative in the lines setup just disable validation for that field:

If you get that error on the header that may mean the document no. already exists. You can complete the same step, just disable validation. Check your Purchase Order/Invoice list and make sure there aren't any duplicate numbers being loaded. You may want to set that No. Series for Purchase Documents to be manual so that it doesnt auto assign a number:

Best,
Teagen Boll, CPA