This doesn't address timing attacks, which are why this is done in the first place. If the code checks only for a username existing and returns the error message, this takes a measurably different amount of time compared to then also looking up if the password matches. The error shown isn't to dissuade people from using web pages to try to gain access to accounts - it's because the raw code itself doesn't know which…
I feel like the variance in network latency is going to be an orders of magnitude larger than the extra time it takes to test a password.
Network latency variance just means you need to sample more. It doesn't prevent the attack.