S3 load (python sdk) produce json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Hello, I am trying to load an S3 block in order to perform a deployment in an specific S3 storage (which I have as a block in the prefect cloud).

The code is:

client = PrefectClient(
            api=environ.get("PREFECT_API_URL"), api_key=environ.get("PREFECT_API_KEY")
s3_storage = S3.load(name=FLOWS_BUCKET, client=client)

I am getting the following error:

Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/usr/src/app/arma_flows/build_flows.py", line 46, in build_flows
    "storage": get_default_storage(),
  File "/usr/src/app/arma_flows/build_config.py", line 81, in get_default_storage
    s3_storage = S3.load(name=FLOWS_BUCKET, client=client)
  File "/usr/local/lib/python3.10/dist-packages/prefect/utilities/asyncutils.py", line 255, in coroutine_wrapper
    return call()
  File "/usr/local/lib/python3.10/dist-packages/prefect/_internal/concurrency/calls.py", line 383, in __call__
    return self.result()
  File "/usr/local/lib/python3.10/dist-packages/prefect/_internal/concurrency/calls.py", line 283, in result
    return self.future.result(timeout=timeout)
  File "/usr/local/lib/python3.10/dist-packages/prefect/_internal/concurrency/calls.py", line 169, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.10/dist-packages/prefect/_internal/concurrency/calls.py", line 346, in _run_async
    result = await coro
  File "/usr/local/lib/python3.10/dist-packages/prefect/client/utilities.py", line 40, in with_injected_client
    return await fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/prefect/blocks/core.py", line 802, in load
    block_document = await client.read_block_document_by_name(
  File "/usr/local/lib/python3.10/dist-packages/prefect/client/orchestration.py", line 1348, in read_block_document_by_name
    return BlockDocument.parse_obj(response.json())
  File "/usr/local/lib/python3.10/dist-packages/httpx/_models.py", line 756, in json
    return jsonlib.loads(self.text, **kwargs)
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I found the error, the error was setting the app URL (https://app.prefect.cloud) instead the api URL (https://api.prefect.cloud) but anyways probably the function read_block_document_by_name expect a result in json format and it produced a non-controlled error like this which is difficult to understand what is happening.