I don't have the build record for it, but TS13571L has had TS13986E since at least 1975 or so; a difference of 415.
The commission number was assigned before they started assembling the car; in effect all cars were built to order (tho usually the factory generated the order). Then as the car worked it's way through the assembly sequence, any problem found might see it sent back up the line for correction or even set aside for a few days (or weeks) waiting for a particular part (eg Alfin brake drums). So they weren't necessarily finished in order. In some cases, I believe there were even gaps in the commission number series.
I suspect the same thing happened with the engines, the engine number was assigned first (along with the specifications and options) and they weren't necessarily finished in order. In some cases, specific engines would have been assigned to specific commission numbers (if, for example, the order included the optional alloy sump or 86mm liners), but I'm guessing that usually they just grabbed any engine handy that met the requirements. They weren't kept neatly lined up on a conveyor belt! (As a side note, the Morgan engines had different options, like the fan mounted to the water pump instead of the crankshaft, so engines had to be assigned a destination before being built.)
On top of all that "process", mistakes were certainly made. I particularly enjoyed Jonmac's story of finding a car in the showroom with wire wheels on one side, steel wheels on the other, and one of each in the boot!