For anyone finding this, I do not recommend deleting the modules section of the project file, as it can make the project completely unable to compile (and putting it back in can be a bit of a pain as well, I literally had to create a duplicate project in another part of my hard drive to copy the modules section from in order to even get the original project to read again). In other words, if there’s no module definition then it can’t create the module; however, the module is failing to compile because of an unknown error. Next thing you know, you end up with a very annoying matter of chickens and eggs.
In my case, it ended up being an SDK issue which required a system restart to properly detect. (Can’t be any more specific for reasons, but what I can say is that it’s always worth checking every single prerequisite to make sure that something didn’t get borked, even if it’s not a direct part of the Unreal code.)