Zigbee: Copy Zigbee firmware from a device

I accidentally installed the wrong firmware on a device (temperature sensor and siren) and now these two devices no longer work. However, I have both devices in duplicate and could copy the firmware from one of them.

How can I copy the firmware from one device and install it on the same device again?

The firmware reading out and installing should preferably work OTA.

Thank you.

Hi, which devices and which zigbee integrations do you use?
Not that I know how, or if, this can be done but I guess this info might be useful.