A uniform number on [0,1] becomes on [0,255] after multiplication by 255. A value like 0.9999999 will become 254.9999745 after the multiplication and will be rounded down to 254. Values of 255 will NEVER (or almost never) occur.
The multiplication should be by 256, not 255. (Whether this will result in very rare instances of an “illegal” 256 result depends on python library details.)
If my arithmetic is correct, the std-dev of the uniform {0,1,2,…,255} is about 73.9; so in an 11-million component image (the size of the full image linked from Wikimedia) this means that, if the components are drawn from that distribution, the average component should have a 95% chance of lying between 127.478 and 127.522. (FWIW, I actually checked the image we’re commenting on and determined that, yes, its components had the incorrect 127.0 average, as expected.)
To get an average as low as 127 or as high as 129 (let alone the 0 or 255 values needed for all-black or all-white image) would be a “22.5-sigma event” – VERY unlikely. Producing an all-black image at random is … unlikely.