This is a concurrency issue. Here's the condition under which this occurs:
1) Transaction A begins
2) Transaction A creates a new copy of parent doctype for a new version
3) Transaction B begins
4) Transaction B is creating a new document type
5) Transaction B creates the new doctype to point to the current parent (our parent which is in the process of being reversioned by Transaction A).
6) Transaction A flips the current indicator of the old doc type to 0 and the current indicator of the new one to 1.
7) Transaction A re-points all existing children doc types to the new parent (except of course the one being created by Transaction B because of transaction visibility) and saves everything.
8) Transaction A commits.
9) Transaction B save it's new document type.
At this point, the document type created by transaction B is pointing to a parent document type which is no longer current.