Your understanding of how the motor oil viscosity system works in incorrect.
20w50 is a 50 weight at 100C
10w40 is a 40 weight at 100C
At any point BELOW 100C, they are HEAVIER than that.
The number BEFORE the W basically indicates the oil's resistance to thickening, it is not a viscosity number. For example, a 5w40 and 0w40 can both be an SAE grade of 40 at 100C, but the 0w40 will thicken less (usually... VI comes into play here, but that's not really necessary to discuss right now) as the temperature plummets.
The lower the number in front of the "w", the more resistant to thickening the oil is and usually this goes hand in hand with a lower MRV and lower pour point.
Each number listed in front of the W corresponds with a low temp MRV reference temperature.
for example:
0wXX is referenced at -40C
5wXX is referenced at -35C
10wXX is referenced at -30C
20wXX is referenced at -20C
There is a maximum thickness that the oil cannot be heavier than at this temperature, which varies accord to the grade, IE 20,30,40,50....etc. A 0w40 can be heavier at -40C than a 0w30, both have a maximum viscosity at -40C for their respective grade.
If your engine is running COLD, you want a LIGHTER oil in there, because your oil is never getting to the 100C temperature.
To better illustrate this, we'll use Pennzoil 20w50.
At -20C, it has an MRV of 25,600cP
at 40C it has a viscosity of 158.3cSt
at 100C it has a viscosity of 17.6cSt
SAE30 is between 9.3 and 12.5cSt at 100C.
17.6 is in the range for a 50-weight oil. 158.3 is obviously a LOT heavier than that. If your oil never gets above 40C (which I doubt but let us use that number as an extreme example) you are running an oil that is TWELVE TIMES HEAVIER than the limit of the SAE30 viscosity grade