Without a call stack it's difficult to determine what the issue is, but I was able to solve it by picking this commit: https://github.com/LineageOS/android_build_soong/commit/6f53e1445524b3d2b0519fb14e4652416e65eddd
You may need to also pick this first to avoid conflicts: https://github.com/LineageOS/android_build_soong/commit/cc1c4aaf9a11e4eb01ad385c46723423a2665ebc