Now I have this weird idea of assembly machines breaking and requiring servicing in the same way, getting turned into a broken machine marked for deconstruction and a matching ghost for a working machine. But that probably is fit for another mod.
The best way to handle this would be to add remote calls so mods could register their own bot failure rates and possibly even their own repair recipes. But I highly doubt any mods would use it. I mostly play on vanilla and try to keep my code as general as possible so it (usually) works with other mods.
I doubt I would use this method as I'm sure mods would complicated it, it could technically be possible to return 95% of the flying robot frame ingredients, and simply expect the player to rebuild the robot entirely. I imagine this would get complicated for mods, as I'm decomposing an ingredient rather than the bot itself so I'll need a really good method for identifying the expensive component of the robot and not the inexpensive one like the electronic circuits. Or... I could just use the method I described.