  For a finite Coxeter group $W$, Josuat-Verg\`es derived a $q$-polynomial
counting the maximal chains in the lattice of noncrossing partitions of $W$ by
weighting some of the covering relations, which we call bad edges, in these
chains with a parameter $q$. We study the connection of these weighted chains
with parking functions of type $A$ ($B$, respectively) from the perspective of
the $q$-polynomial. The $q$-polynomial turns out to be the generating function
for parking functions (of either type) with respect to the number of cars that
do not park at their preferred spaces. In either case, we present a bijective
result that carries bad edges to unlucky cars while preserving their relative
order. Using this, we give an interpretation of the $\gamma$-positivity of the
$q$-polynomial in the case that $W$ is the hyperoctahedral group.
