The self-replication assumes also that there is enough energy stored in each planet (or coming from a Sun) to do the work... That is pretty much unlikely.
Any chemical bond is a potential source of energy. Plenty of sources of potential energy too able to be converted to work.
And stored in the specific forms the machine can exploit.
Over a long enough timescale, though… really, really slow solar trickle charge to a space-capacitor bank? A thousand years’ suns, culminating in a glorious orgy of smelting?