Dijkstra Counter Example
initially you have:
Q={A, B, C, D, E}
dist(A)=0, dist(B)=dist(C)=dist(D)=dist(E)=inf
previous(A)=previous(B)=previous(C)=previous(D)=previous(E)=undefined

from Q the vertex with min distance is A. Therefore you choose A and you do
(dist(A)+length(A,B)

your remove A from Q, now you have
Q={B, C, D, E}
In Q the vertex with the min dist is C with dist(C)=5, so you pick C
the only vertex adjacent to C is D so you have
(dist(C)+length(C,D)

you remove C from Q, now you have
Q={B, D, E}
the vertex with the min dist in Q is B so you pick B
(dist(B)+length(B,D)

you remove B from Q, now you have
Q={D, E}
the vertex with the min dist in Q is D so you pick D
(dist(D)+length(D, E)

you remove D from Q, now you have
Q={E}
the vertex with the min dist in Q is E so you pick E
No neighboors
remove E from Q
Q is empty and the algorithm terminates
previous(E)=D
previous(D)=B
previous(B)=A
so this is your shortest path from A to E

I skipped the distance checking for the previous vertex for simplicity (it is always equal), the algorithm performs this check. I think you confuse picking a vertex from the set Q and changing the distance of a vertex. They are two different things. The fact that you are assigning a distance at some point to a vertex does not mean that it will be final. It will be final only when this vertex have the minimum distance in the set Q and it will be the one to be picked next and removed. I hope I am clear.