When building zsh with kcp, the following error is thrown:
Test ./E01options.ztst failed: error output differs from expected as shown above for:
showopt() { setopt | egrep 'localoptions|ksharrays'; }
f1() { setopt localoptions ksharrays; showopt }
f2() { setopt ksharrays; showopt }
setopt kshoptionprint
showopt
f1
showopt
f2
showopt
unsetopt ksh_arrays
Was testing: LOCAL_OPTIONS option
./E01options.ztst: test failed.

Online search shows it worked for someone after doing make clean. So, I added it to PKGBUILD just before make in the build section. However, that did not work.

Any ideas how this can be resolved?

KCP is not KaOS maintained, it is maintained by users like you. Many who are active in KCP do not frequent the forums, so you probably have a better chance to get help by opening an issue in KCP > zsh.