I think I have somewhat traced the problem to a duplication of unknowns. When I get a method that manages to compose. The structural_simplify then fails and this seems to be because the unknown dfneq.neq appears both as a list of individual elements aka. dfneq.neq(t)[1], dfneq.neq(t)[2] etc. and as an individual dfneq.neq(t) also in the list. I am not sure what is generating this second version of the vector in the variables map.