However, Dynare simulates 1003 periods of the endogenous variables and 1002 periods of the exogenous variables. Why is this and how does the timing of the shocks and endogenous variables line up?

Your model probably contains one lag (on endogenous variables), so there must be one period of initial conditions before the simulation starts.

So the first date of the exogenous vector is date 1, and the first date of the endogenous vector is date 0.

So there are truly 1002 periods of simulation, and 1 period of initial conditions.

The fact that there are 2 extra simulation periods is a small bug of Dynare, but without real consequences since you can just truncate the simulations.