Possible Solution
When finding the anchor, sort the tables by the number of tables in ascending order. This way the most inner table will be checked first.
example code change is to change
"for table in part.findall('.//{%(w)s}tbl' % NAMESPACES):"
to
"for table in sorted(part.findall('.//{%(w)s}tbl' % NAMESPACES), key=len):"
Possible Solution When finding the anchor, sort the tables by the number of tables in ascending order. This way the most inner table will be checked first. example code change is to change "for table in part.findall('.//{%(w)s}tbl' % NAMESPACES):" to "for table in sorted(part.findall('.//{%(w)s}tbl' % NAMESPACES), key=len):"
Environment