Is your gearbox 6 or 8 speed? The 6 speed was around for a while and I don't know of widespread problems. There was a "recaĺl" ie selectors replaced during routine servicing around 2011/2012 because they got suck in park and would not rise when the engine was started.
My 6 speed auto on a 3 litre diesel XF has done 193000 miles without a glitch. It's supposed to be sealed for life but I got the filter and transmission fluid changed recently as nothing lasts forever.
You might find the problem just goes away. There is so much electronic kit on these cars there's always a bit that's not wide awake every morning. I have had climate control not available, sat navigation not available, adaptive cruise control not available, TPMS faults etc etc. All these problems have sorted themselves and once past 170,000 miles most have not reoccured.
Paul G