How to start using signrawtransactionwithkey instead of signrawtransaction
If you just want to sign the raw transaction as it's shown in the tutorial, please use signrawtransactionwithwallet instead. It would be like below.

$ signedtx2=$(bitcoin-cli -named signrawtransactionwithwallet hexstring=$rawtxhex2 | jq -r '.hex')
$ bitcoin-cli -named sendrawtransaction hexstring=$signedtx2
69c9ef4d1adb48596c470146ee9b60593023b6eb870b79ef666a8c9369768469