71 block in a 72 duster. Did this happen at the assembly plant

Generally speaking, the engine would be built before the actual build date of the car itself.
That goes for most if not all of the other components that goes into a new car.
If you think about it, it only makes sense that it is that way.
The parts to build the car are assembled ahead of time so when the car goes down the production line, the workers see what parts are called for on the build sheet and then they are picked and ready at each station that the car stops at while being built.
For example, if a car calls for a 340 and a four speed, it goes right past the slant six and automatic station.
There will be several assembled engines with transmissions already bolted together and on a k-member so it can be slipped into the car as it passes along the assembly stations.
The engines, transmissions, and other items in the assembly need to be joined together and form sub units.
The blocks are cast (which the date is cast into the block at that time) and then it needs to be cleaned, machined, and assembled. Then it is sent to the factory to have other components bolted onto it such as transmissions, accessories, mounts, etc.
Then when the car is ordered, they assign a ''scheduled production date'' to the car.
The actual build date may vary depending on availability of all of the components needed to actually complete the car.
It may be delayed because say 340 4 speed air conditioned engines with manual steering assemblies have been delayed for 3 weeks.
They will then build the car when they know that the parts are in house, other than a few small items that could be changed on the fly if need be to push the car through.
The general rule is about 2 months from when the block was cast until it is finally assembled and ready to go into a car.
It's not unusual to see 6 months or even a week ahead of actual build date for some castings and components.
Then there are substitutions and discontinuation of certain items that factor into this scenario as well as using up of older stock to just get rid of it.
As the car is assembled, then they stamp the serial numbers into the pads to make it ''matching numbers''.

So, in summary, any car built for say the '72 model year that is built between August and December 31st of '71 will have date codes and casting dates in '71.
Anything built after that could have both or '72 dates on it, depending on how close the supplier cuts it to replenish the parts bins.

I hope this explains a few things............
Good luck,
Tom.