Hours spent with sub-tasks

Something I don’t really get.
I have time tracking on both issues and subtasks (alternatively).
I’m using issue type and issue dimensions, with the detail on issue.
If I use the “hours spent” measure, I get the hours spent at issue level if the issue has no subtasks, and null if it does.
If I use “hours spent with sub-tasks” measure, I get 0 on issues and subtasks, and the total only on those issues that have subtasks.
Looking at the measure formula, I should have issue hours spent + subtasks hours spent, so why do I get 0 if the issue has no subtasks but has tracked hours?