The azimuthal variation of jet yields in heavy-ion collisions provides information about the path-length dependence of the energy loss experienced by partons passing through the hot, dense nuclear matter known as the quark--gluon plasma. This paper presents the azimuthal anisotropy coefficients ${v}_{2}, {v}_{3}$, and ${v}_{4}$ measured for jets in $\text{Pb}+\text{Pb}$ collisions at $\sqrt{{s}_{\mathrm{NN}}}=5.02$ TeV using the ATLAS detector at the LHC. The measurement uses data collected in 2015 and 2018, corresponding to an integrated luminosity of 2.2 ${\mathrm{nb}}^{\ensuremath{-}1}$. The ${v}_{n}$ values are measured as a function of the transverse momentum of the jets between 71 and 398 GeV and the event centrality. A nonzero value of ${v}_{2}$ is observed in all but the most central collisions. The value of ${v}_{2}$ is largest for jets with lower transverse momentum, with values up to 0.05 in mid-central collisions. A smaller, nonzero value of ${v}_{3}$ of approximately 0.01 is measured with no significant dependence on jet ${p}_{\mathrm{T}}$ or centrality, suggesting that fluctuations in the initial state play a small but distinct role in jet energy loss. No significant deviation of ${v}_{4}$ from zero is observed in the measured kinematic region.