Is latvian your default language? Did you choose to hide the language code for the default language?
Yes, it is. I didn’t but now I did and at least the archives work for default language(since language/lv part got removed). For others(ENG/RUS) it still fails. Any suggestions?
For the search form, your theme is doing things wrong. But there should be workaround. One of it is to choose to redirect the homepage to the language page in Polylang settings.