  The pseudorapidity dependence of elliptic ($v_2$), triangular ($v_3$), and
quadrangular ($v_4$) flow coefficients of charged particles measured in Pb-Pb
collisions at a centre-of-mass energy per nucleon pair of $\sqrt{s_{\rm
NN}}=5.02$ TeV and in Xe-Xe collisions at $\sqrt{s_{\rm NN}}=5.44$ TeV with
ALICE at the LHC are presented. The measurements are performed in the
pseudorapidity range $-3.5 < \eta < 5$ for various centrality intervals using
two- and multi-particle cumulants with the subevent method. The flow
probability density function (p.d.f.) is studied with the ratio of flow
coefficient $v_2$ calculated with four- and two-particle cumulant, and suggests
that the variance of flow p.d.f. is independent of pseudorapidity. The
decorrelation of the flow vector in the longitudinal direction is probed using
two-particle correlations. The results measured with respect to different
reference regions in pseudorapidity exhibit differences, argued to be a result
of saturating decorrelation effect above a certain pseudorapidity separation,
in contrast to previous publications which assign this observation to non-flow
effects. The results are compared to $3+1$ dimensional hydrodynamic and the
AMPT transport model calculations. Neither of the models is able to
simultaneously describe the pseudorapidity dependence of measurements of
anisotropic flow and its fluctuations. The results presented in this work
highlight shortcomings in our current understanding of initial conditions and
subsequent system expansion in the longitudinal direction. Therefore, they
provide input for its improvement.
