This PR gets rid of another unnecessary use of raw pointers, similar to PR #19053 (see also issue #19062 where useful commands for finding potential candidates are listed) but in the tx verification module.
For the functions CalculateSequenceLocks() and SequenceLocks(), the  prevHeights vector parameter type is changed to be passed as a reference. Note that there were no checks for null pointers – if one would pass nullptr to one of the functions, the following line would immediately lead to a crash:
https://github.com/bitcoin/bitcoin/blob/dcacea096e029a02a937bf96d002ca7e94c48c15/src/consensus/tx_verify.cpp#L32