Before running any critical fastboot command, ensure you are in Fastboot mode then it is always a good idea to run first
fastboot devices
This simply asks the phone to identify itself.
If this command fails, you know that you have some elementary problem.
If you should be running Windows this would likely be a driver issue, perhaps like this case /e/os web installer cannot connect to Fairphone 3 in Fastboot mode - #2 by aibd.