Google Search redirect error

I have tried everything, no luck!

I have Next.js site and week ago Google Search console show that cant index my site: https://kldsolutions.lv/

I have player adjusted my Middleware and layout page but I still cant verify it.

From curl.exe -A “Googlebot” -I https://kldsolutions.lv I get this:
HTTP/1.1 307 Temporary Redirect
Age: 22
Cache-Status: “Netlify Edge”; fwd=miss
Content-Type: text/html; charset=utf-8
Date: Thu, 30 Jan 2025 15:03:53 GMT
Etag: W/“27-ghawzGh2y9RPAcFY59/zgzzszUE”
Link: https://kldsolutions.lv/; rel=“alternate”; hreflang=“lv”, https://kldsolutions.lv/en; rel=“alternate”; hreflang=“en”, https://kldsolutions.lv/; rel=“alternate”; hreflang=“x-default”
Location: https://kldsolutions.lv/en
Server: Netlify
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Locale: lv
X-Nf-Request-Id: 01JJVVT6VS8ZRFXVJ9CGQWMMPQ

Location is set to redirect to /en which isnt correct.

Maybe someone have an idea what else I can check? I have deployed clearing cache multiple times.
I tried other bots as well - same issue.
Page itself works great, the problem is only with indexing on Google Search console.

I changed how my webesite handles i18n.
I think its Nextjs problem, but im not sure:

PS C:\Users\emils> curl.exe -A “Googlebot” -I https://kldsolutions.lv/lv
HTTP/1.1 200 OK
Age: 1
Cache-Status: “Netlify Edge”; fwd=miss
Content-Type: text/html;charset=UTF-8
Date: Fri, 31 Jan 2025 12:09:00 GMT
Etag: W/“188bb-HAVuc3ZyvPbB9o3mvE7kY+WcAkU”
Server: Netlify
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Nf-Request-Id: 01JJY47BNC1VABA12TSFBBT8NH

PS C:\Users\emils> curl.exe -A “Googlebot” -I https://kldsolutions.lv
HTTP/1.1 307 Temporary Redirect
Date: Fri, 31 Jan 2025 12:08:47 GMT
Link: https://kldsolutions.lv/lv; rel=“alternate”; hreflang=“lv”, https://kldsolutions.lv/en; rel=“alternate”; hreflang=“en”, https://kldsolutions.lv/; rel=“alternate”; hreflang=“x-default”
Location: https://kldsolutions.lv/lv
Server: Netlify
Strict-Transport-Security: max-age=31536000
X-Nf-Request-Id: 01JJY46ZBDJ7WVHSGQTSF93A97

What do you get when you run next build && next serve locally? Does this work according to your expectations there?