It depends a bit on the AV, but most have different protection layers. And for example URL protection is different than file protection. So, if you have a malicious url that downloads a malicious file, and the products already has a detection for that malicious url in place, then it will just block the file based on the fact that it's source is bad. It does not further analyse the file. That is good of course, because it adds an extra layer of protection. But at the same time when testing, you really want to know if a product also can block the actual file that is executed, no matter it's source.
The latter is done based on the file's actual behavior, not it's source. That means in practical terms that, if the file is detected, it doesn't matter it ends up on your computer using a drive-by download, an email attachment or social media spam, it'll be blocked regardless. If you rely on URL-based blocking first in a test, without looking at actual file/behavior blocking, there's no way to know if the product would also have blocked another infection vector (so you know a drive-by download would have been blocked, but you have no way to know if the same malware would still have been blocked if it would have been dropped by a malicious email attachment).
When it comes to AV testing imho transparency is a must; if you as the product user don't know how a test is performed, there's no way for you to make a decision on how well the product will protect you; a 100% score on a test means nothing if a test is not conducted properly or if you have no idea how the test was done in the first place.
Finally to answer your question:
if windows defender doesn't detect the threat when the user executes the executable (when it has all the info available to analyze the actual file and behavior of it), how would it be more effective at detecting the threat even before downloading the malicious file?
It would be more effective is a known malicious link is used; that relies only on url blocking without looking at the file.