That workaround doesn't work correctly for me, either.
Possibly because my local pokeapi installation doesn't run on localhost but a custom hostname.
It does try to resolve the expected Collection by calling the falsely delivered URL but doesn't prepend the baseUrl properly.
There's a workaround in PokeAPI\Client class to address this open issue: https://github.com/PokeAPI/pokeapi/issues/345
That workaround doesn't work correctly for me, either. Possibly because my local pokeapi installation doesn't run on localhost but a custom hostname. It does try to resolve the expected Collection by calling the falsely delivered URL but doesn't prepend the baseUrl properly.
My (also ugly) fix for this was to replace:
with