Have never tried writing a RPi program image to SD card using another RPi, in theory should work, "Raspberry Pi Imager" is installable on RPi OS, see link to Raspberry Pi Org in Reply #7, that's assuming that a suitable USB/SD card adapter is available and is recognised by the RPi.
I do have a currently unused RPi-4B running the latest RPi OS (Bullseye) on the bench at present and an available USB/SD adapter, will try to get time to experiment with this and advise results.
Currently very busy with my Shelly EM energy monitor which has worked faultlessly for many months until I decided to move one of the CT's which involved disconnecting/reconnecting, I foolishly did so without powering down and reconnected after installing the CT on an active, flowing conductor, have at least "bricked" the CT, which appears to have integral active circuitry, and possibly the EM unit as well, still under test.
A lesson learned, always read and digest the "small print" in the instruction manual