I managed to resolve it for the time being, by deleting the Intermediate folder, regenerating project files and compiling.
I had renamed modules/files/classes a few times, and it seems that folders by the old names (i.e. “Independent1, Dependent2, Independent3”) were still showing up in the Intermediate folder. I think that’s where the .generated.h. files come from, and there must have been duplicates from outdated modules screwing things up. That’s my best guess anyways.
I’ll leave the answer open for the time being, in case someone from Epic wants to provide a more coherent/knowledgeable answer.