Having the exact same problem with UE 5.2.1
I could fix this in my case: (It had to do with the Rider Plugin)
- Restart Rider and invalidate cache.
- Quit Unreal Editor
- Remove the Binaries folder of the project and restart Unreal Editor
Plugin creation worked fine after that.