Treedict was intended for nested usecase, where there are submodels like in https://github.com/pymc-devs/pymc/blob/main/pymc/model/core.py#L529, https://github.com/pymc-devs/pymc/blob/main/pymc/model/core.py#L478 . But marginalized model is not supposed to be used like that, so the functionality can be removed and simplified https://github.com/pymc-devs/pymc-experimental/blob/4f75687346cb67cfb794dad00bc2cac52066a8b7/pymc_experimental/model/marginal_model.py#L17