Convert affine to projective coordinates and vice versa in ECC?
Somewhere you seem to have made a small mistake. $39$ is already the inverse of $Z_{2Q}$. The correct value of $Z_{2Q}$ is $\mathbf{32}$.



For the long story, let us first go through the doubling formula one step a time:

if (Y == 0)                     # nope
 return POINT_AT_INFINITY
W = a*Z^2 + 3*X^2               # W = 0
S = Y*Z                         # S = 38
B = X*Y*S                       # B = 25
H = W^2 - 8*B                   # H = 15
X' = 2*H*S                      # X'= 22
Y' = W*(4*B - H) - 8*Y^2*S^2    # Y'= 31
Z' = 8*S^3                      # Z'= 32
return (X', Y', Z')


This leaves us with $2Q = (22 : 31 : \mathbf{32})$.

To compute the affine representation, we compute $Z_{2Q}^{-1} = 39$. Now the affine representation of $2Q = (XZ^{-1}, YZ^{-1}) = (22 \cdot 39, 31 \cdot 39) = (41, 5)$.