The issue you are experiencing is likely due to the fact that the resource is not always immediately available when the API call is made. This is because the resource may be in the process of being created or updated, and the API call is being made before the resource is ready.
To improve reliability, you can try adding a delay before making the API call, or you can use the if-none-match
request header to check if the resource has been updated since the last time the API call was made. If the resource has not been updated, the API will return a 304 Not Modified
response, which can be used to avoid making unnecessary API calls.