Assume power can source infinite current at 5V for the moment.
With 0.5 ohms of resistance, now definitely 10 A will flow through the resistor.
It follows ohms law.
Once power source has limited abilities such as only 10 W, it means that it is able to deliver up to 10 W happily but not more.
If you connect a 5 ohm resistance, 10W power supply will supply 1 A as current. So, the power supplied is 5W though the capacity of power supply is 10 W.
As soon as the power expected by the load goes beyond the power supply capability of source, one can't assume ohms law.. Because the output voltage from the source will not be 5V.
Either the output voltage from the power supply may drop or even cutoff the lower all together (over load protection or short circuit protection circuits may kick in)
Stay below the power capacity of the supply and the ohms law will be valid.