The reason your rc is not updated in your example is because bash will create a subshell when using a pipe
One solution to your problem is to use "${PIPESTATUS[@]}"
#!/usr/bin/bash
curl --max-time 5 "https://google.com" | tee "page.html"
echo "curl return code: ${PIPESTATUS[0]}"