There are two kinds of (rotary or linear) position encoders: relative and absolute. A relative encoder only "knows" what the position is relative to what position it was in when the encoder was powered on.
The DH parameters define the arm's joint arrangement. It looks like your upper/first image would be the DH parameters with the joints all at an absolute zero value.
If the encoders were relative, you could turn power off to the arm, reposition it manually, and then power it back on. The relative encoder has no knowledge of what happened while it was powered off and so they always default to zero on startup.
The joint configuration didn't change, but your value for $\theta_3$ changed because it's now offset - this is the information that was lost when the joint was reconfigured.
The $\pi/2$ value is the "joint angle correction" to account for the fact that you are treating the joint angle $\theta_3$ as "zero" when the arm is straight.