A V10 from 2006 would use a different CAN-bus version than a V10 from 2009. Because of that the control module from the engine (ECU) couldn't talk to the rest of the car (including the transmission, the instrument cluster and the access/start authorization module, which all would be essential), unless all of them were also replaced.
So, if the model year is right and you don't have a unicorn V10, it's highly doubtful that you really have an engine from 2009 in your 2006 car working, without getting a ton of fault codes and a very limited performance. And if you don't, then I don't know how you could possibly have an actual R50 tune (meaning on original firmware, not something that supposedly gives you similar performance) on the car, when R50s were using the newer CAN-bus version, with obviously a different ECU, and also had a different engine code.
Same thing with the transmission. Also, even late regular V10 transmissions had a different rating (850 Nm) than R50 transmissions (1000 Nm). I'm not sure how the former one would actually cope in place of the latter, but it might be very costly to find out, even if the engine electronics would be otherwise a good fit.
In short: if you want an R50, just get an R50, because afaik converting a 2006 V10 to an R50 is pretty much close to impossible. And the way it would be still possible just doesn't make financial sense.
Your actual and current engine code could be determined by the stickers on it, if still any present, or by looking at the part number and firmware version reported by the ECU. At least in the case of stuck units, because I'm not sure how much that term makes sense in the context of a tuned engine that had either firmware and/or possibly also some hardware components changed/replaced, and which in turn won't really match any of the stock engines, but will be some kind of hybrid matching neither of them.