@megasd21 It’s been a while since I’ve done this sort of thing, but I’d take a look at how modules load and are expanded and assemble a minimal test case at that level.
Also IIRC you can look at the various expansions in the config and prepped and system etc
Thank you very much for the tips @rickmoynihan,that should give me some direction for further investigation
stuff like duct.core/prep-config duct.core/merge-configs duct.core/fold-modules etc
It must be due to modules being applied to the config map after profiles. I ended up creating a module of my own to exclude the offending middleware from the middleware vector.