useAPI in checkout ui extension

I have a checkout ui extension and that uses query from useAPI() - occasionally it throws off “Could not get a storefront token for app gid://shopify/App/(actual number) to query {\n node(id: "gid://shopify/ProductVariant/..” - is this something that can be controlled by the developer? Is this a normal thing and is automatically retried?