Correlations between mean transverse momentum [pT] and anisotropic flow coefficients v2 or v3 are measured as a function of centrality in Pb–Pb and Xe–Xe collisions at sNN=5.02 TeV and 5.44 TeV, respectively, with ALICE. In addition, the recently proposed higher-order correlation between [pT], v2, and v3 is measured for the first time, which shows an anticorrelation for the presented centrality ranges. These measurements are compared with hydrodynamic calculations using IP-Glasma and TRENTo initial-state shapes, the former based on the Color Glass Condensate effective theory with gluon saturation, and the latter a parameterized model with nucleons as the relevant degrees of freedom. The data are better described by the IP-Glasma rather than the TRENTo based calculations. In particular, Trajectum and JETSCAPE predictions, both based on the TRENTo initial state model but with different parameter settings, fail to describe the measurements. As the correlations between [pT] and vn are mainly driven by the correlations of the size and the shape of the system in the initial state, these new studies pave a novel way to characterize the initial state and help pin down the uncertainty of the extracted properties of the quark–gluon plasma recreated in relativistic heavy-ion collisions.