Please read the OP before replying with an answer.
I have read your post and the linked thread, please read my posts as well and try what I suggested.
First of all the first thread you linked to is rather old, and while systemd-inhibit can still be used it's recommended to configure that via logind.conf.d
There are actually two different things in play: one thing is system(d) handling of power/sleep/... buttons the second one is how kodi should handle those.
You need to solve the systemd handling first. stop kodi (systemctl stop kodi), run evtest (from system tools addon) to find out the input device of your remote and then run evtest --grab /dev/input/eventX (replace eventX with the one matching your remote) and press the power button on your remote - this will tell you if it's sending KEY_POWER or KEY_SUSPEND or something else.
Then setup logind.conf to ignore that key. Reboot, stop kodi again and verify that your system does not power down when you press the button.
Once you got that working you can start configuring kodi.
so long,
Hias