Example code from docs for cart not working

Hello Folks,

i have trouble to get the example from here running https://docs.shopware.com/en/shopware-platform-dev-en/api/sales-channel-cart-api?category=shopware-platform-dev-en/api

I copied the code at the end to a html file and created a demo shop througt the shopware demo shop link at the top of this forum. After that i put in the needed credits and let the script run it fails to load the countries with 404 Not Found.

The code is below

 function getCountry(iso3) {
        const url = `${baseUrl}/sales-channel-api/v1/sales-channel/countries?filter[iso3]=${iso3}`;
        return fetch(url, { method: 'GET', headers })
            .then((resp) => resp.json())
            .then(({ data }) => data[0]);

I checked if the ‚deu‘ country is setup for the sales channel … it is. In addition to that i tried to load it with lowercase and uppercase letters (‚deu‘ and ‚DEU‘). Same result.
To get things further i just got the id for the german countrie from the database and just put it into the order creation code.

After that i setted up a local dev environment and tried to run the same code again. Same results. As far is i can see for order creation the DataBag does not contain any data so the request fails what seems natural to me … but why is it empty?

In addition to that i get the following stack trace response: https://pastebin.com/e1ahnqvD

Thanks in advance