The solution for me was to make a wildcard on my hosting.
So if you are trying to install the multisite on a live website and not on your localhost, most probably this is also your problem.
Login to your CPANEL, go to subdomains and make a subdomain with the name “*” with the root “/public_html” (this may differ on your hosting).
This will allow WordPress to create any subdomain name for your website *.yourwebsite.com