According to the documentation at Mozilla, you can have only one Access-Control-Allow-Origin header:
A returned resource may have one Access-Control-Allow-Origin header, with the following syntax:
Access-Control-Allow-Origin: <origin> | *
You can use * for any origin:
return $response
->withHeader('Access-Control-Allow-Origin', '*');