feat: drop finite-dimensionality assumption from PerfectPairing.restrictScalarsField (#18940)
PerfectPairing.restrictScalarsField