Did you check the console for JS errors?
Mystery (somewhat) solved: some rows returned by the tree query have null in the title column. The APEX Tree implementation seems to just leave those out of the tree data array and if the last node is like that, it generates a dangling comma invalidating the whole array statement:
If the title value is NVLed to e.g. space, it works.