The A400M that crashed was on its first test flight, so unless they've done something very odd with versioning, it's unlikely that all its ECUs had older firmware than planes that already shipped. Besides, with aircraft, all changes are logged with a ton of paperwork, so they shouldn't need to check the aircraft to know what firmware they're running.
It doesn't seem so unlikely to me. Supply chains are long and parts are bought in bulk. I think it's likely that the parts for the ECUs, including boards with chips containing the older firmware, are warehoused where the ECUs are assembled. The ECUs are probably then bought in bulk and warehoused where the planes are assembled. The paperwork for the plane probably includes the ECU serial numbers, but it probably doesn't include serial numbers for all of the components installed on all of the boards inside the ECU, especially if they didn't have the foresight to think that those numbers would matter. Afterall, it seems there's a way to get the firmware version by querying the ECU.
I think you underestimate the tracking done in commercial airplane manufacture. I believe the source of every rivet is well-known. And how many planes do they make? Many parts are likely manufactured as needed, one at a time.
I'm sure the tracking is a lot more detailed than, say, consumer products, but it's probably not as detailed as it is for space hardware. There's a cost to that tracking, and the commercial airplane industry needs to be cost-competitive. So I'm assuming they track well enough to meet their own and government-imposed safety standards, but perhaps not well enough to be able to look up the chip firmware for each circuit board on every in-service airplane in a database.
As far as JIT manufacturing, that's certainly the case for bigger parts and systems, but it sounds like the ECTs are replaceable so they probably have backup replacements stocked near most major airports. (Assuming it's a part that can be replaced during routine pre-flight maintenance.) And the components that go into the ECTs are almost certainly produced in large batches rather than continuously.