Evidence for transverse-momentum- and pseudorapidity-dependent event-plane fluctuations in PbPb and pPb collisions