Tried yesterday, selecting output to SPDIF in kodi, I can hear sound with TV speaker (via HDMI) and soundbar (via SPDIF).
CE version: CoreELEC (community): 19.4-Matrix_devel_20220816091926 (Amlogic-ng.arm)
Box: X96 Max Plus 4+64
Btw I repaired my SPDIF earlier using method in this thread, no idea if it is related or not.
X96 Max fix SPDIF