backport the https://github.com/zephyrproject-rtos/zephyr/pull/76115 to the v3.7-branch fixed by https://github.com/zephyrproject-rtos/zephyr/pull/76498