Refund Session does not exist when performing #resolveSession

Hi!

I have this issue where the Refund Session, when trying to resolve the refund session is not updating correctly on Shopify side.
The Payments Apps API is always responding with:

[GraphQL] response: {“data”:{“refundSessionResolve”:{“refundSession”:null,“userErrors”:[{“field”:[“id”],“message”:“Refund session doesn’t exist.”}]}},“extensions”:{“cost”:{“requestedQueryCost”:11,“actualQueryCost”:10,“throttleStatus”:{“maximumAvailable”:546000,“currentlyAvailable”:545990,“restoreRate”:27300}}}}

Even though the resource was created and my App responded with 201 to Shopify, and the order history reflects the new Refund Session:

This is the code for the refundSession

export const action = async ({ request }) => {
const requestBody = await request.json();
const refundSessionHash = createParams(requestBody);
const refundSession = await upsertRefundSession(refundSessionHash);
if (!refundSession) throw new Response("A RefundSession couldn't be created.", { status: 500 });
return new Response(json(refundSessionHash), {
status: 201,
})
}

This is the resolveSession method:

`async resolveSession({ id, gid }) {
const response = await this.#perform(schema[this.resolveMutation], { id: gid });

const responseData = response[this.resolveMutation];

if (responseData?.userErrors?.length === 0) await this.update?.(id, RESOLVE);

return responseData;
}`

Can anyone help regarding this issue?

It is really becoming a concern since I cannot resolve pending refund session directly.