I think is related to a... let's not call it a bug, but a particular feature of the QIIME 2 import pipeline that casts underscores in tree ids to spaces. My solution has been to transform my ids before import. (I do a find and replace and convert "_" to "-" in both my table and tree.
It may not exactly be your error, but worth a try.