Sorry, I don't understand the scenario.
DocIDs increment for the entire installation of DBXL. So DocType1 can have Documents 1, 2, 3, and DocType2 can have Documents 4, 5, 6.
RefIDs increment for the specific DocType. This means DocType1 will have Documents with RefID 1, 2, 3 and DocType2 will also have Documents with RefID 1, 2, 3.
The SharePoint form library and mapping don't have any memory of the RefID or DocID; those are stored in each XML document.
So perhaps we need to look at the XML documents and their processing instructions (or the Documents tab in DAT) to see their DocID and RefID, and then compare those to what you're seeing in SQL and SharePoint. Perhaps this will tell us whether what you're seeing is expected or not.