JLM203404 is a microswitch on a small bracket that fits at the forward end of the shifter mechanism. Its function is not described but from its position, it looks fairly certain that this switch operates when the lever is moved away from the P position. My guess is that this is the Not in Park switch.
MJA4940AE is a plate bearing two microswitches that operate at different positions of the shifter. It looks like one will operate when the shifter is in R, the other when in D but this thought is only derived from a picture I have seen of this plate.
As I have mentioned before, on XK8 the Drive Away Locking is not really drive away because the doors lock as soon as the shifter is moved out of Park and not when the car starts to move as is the case with some other models. The locking function takes place when a set of conditions is met, not just when the shifter is moved. Other inputs to the controller are likely to be doors closed, key in ignition, key in position II etc. so you can’t just point an accusing finger at one component and say it must be that.
In general, there are two methods of fixing faults. One is that you just change large items until the fault clears, for example, in this case you could just change the entire shifter assembly and see if the that cures it. If it doesn’t you change the module and so on. This is usually adopted by the larger dealers because it is relatively fast and the customer bears the whole cost.
The other way is sleuthing - carrying out a series of tests and interpreting the results. This is the home mechanic’s way because you end up only replacing the faulty part. And, by the way, if it turns out to be a faulty microswitch you can just replace the switch for pennies, you don’t have to by the whole plate, bracket and cable but you either have to do this yourself or find someone with the necessary skills and pay them.
Unfortunately, yours is an irritating, intermittent fault that would annoy the hell out of me but if you have to pay someone else to track it down and fix it I suspect you’ll need deep pockets. Sorry to not be able to be more help.