Google Bot problem while activating redirection to a specific country

hi ,
When redirecting is activated, it works normally, but the problem is that if you choose America among the countries, it will disappear from the search results google. I want a solution, please, so that the site appears in the search, while the redirect remains.

Redirect code link

developers . cloudflare . com/workers/examples/country-code-redirect