I was facing the same issue of unknown Error what I did was I re-installed Visual Studio,the appropriate version of Visual Studio matching your Unreal Engine 5 version is required, with the following modules installed: .NET desktop Development, Desktop Development with C++, Game Development with C++
Hope that helps!