Heard that more often lately, always suggesting those steps:
• Check background downloads: If you are currently downloading or updating a game, the engine install button stays greyed until that download finishes.
• Log out and back in: Sign out of your Epic Games account completely, then log back in to refresh your account permissions.
• Restart the launcher: Fully close the Epic Games Launcher (including from the Windows system tray in the bottom right corner) and open it again.
• Update Epic Games Launcher: And for me, from time to time, that’s just not working properly. Sometimes I uninstall and reinstall due to it not updating. Sometimes I can force the launcher to do that in settings. But you have to check if it went well. Sometimes it’s still asking for an update, which means it didn’t work out properly.
Hope that helps!
I had this same issue and tried all the suggestions from other users experiencing this issue. None of them worked for me so I decided to leave it for 30minutes while I installed visual studion and git on my machine and after doing that and returning to try download unreal engine, it was working for me:

