Why does useExtensionApi cause an error in product search on POS UI extensions?

I can’t seem to get the useExtensionApi working properly to fetch products with the productSearch.fetchProductWithID() endpoint. The extension crashes whenever i call this method inside my SmartGridModal. What am I doing wrong?

Even the searchProducts() endpoint isn’t working and thats copy+pasted from the docs: https://shopify.dev/docs/api/pos-extensions/ui-extensions-reference/api/product-search

I have tried both in react js and react ts

UPDATE: I now know the result is a Promise. The thing is, whenever I do an await then it crashes again. Without await, it’s a promise of an object and when i call the title property I get an undefined.