Theres your problem
CURLOPT_RETURNTRANSFER => false
and/or
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
This should be true for both requests.
Other wise
$response = curl_exec($ch);
Contains nothing useful
https://www.php.net/curl_setopt
TRUEto return the transfer as a string of the return value of curl_exec() instead of outputting it directly.
I just didn’t clock it in your original post