When setting up the search engine to integrate with other apps, I accidentally wrote "https://www.kagi.com/search?q=".
Turns out, Kagi doesn't use www, but instead of redirecting to "https://kagi.com/search?q=" it instead dropped the 'search' part in the URL and led me to "https://kagi.com/?q=". This is quite confusing behaviour and took me a while to figure out what was happening.
Generally it is customary when redirecting www to non-www to keep the full path in tact.