Here's the problem summary:
Return button won't work when the cursor is at the end of a word that doesn't start with a number. (When the word starts with a number or the cursor is manually placed in the middle of the word, there's no problem).
The problem only occurs with a combination of Kagi and Gboard <13 and word suggestions turned on. Doesn't appear with any other virtual keyboard, but doesn't appear with any other app or website either, so really not that sure if it's a Kagi or a Gboard glitch. Upated Gboard to 13.x now, but that's quite a bummer, as I was using a lower version on purpose (recent Gboard has becomme really bad). So while I've won a search engine, I've lost my keyboard. 😥
Maybe someone from Kagi's programming crew can look over this, possibly there's an error on Kagi's end as well and fixing it might be a win-win. Thanks!