1) Isn't it "getaddressinfo" instead of "validateaddress" ?
The "validateaddress" command does not return "pubkey" property.
2) Updated "bitcoin-cli -named signrawtransaction hexstring=$rawtxhex" to "bitcoin-cli -named signrawtransactionwithwallet hexstring=$rawtxhex"
3) Updated "... had to give signrawtransaction extra help ..." to "... had to give signrawtransactionwithkey extra help ..."