by Tim Hunt.
When backup/restore code works, it is really great. When it does not work, it can be really, really hard to work out what is going on.
One technique is to find some other code in another plugin that works, and then compare what they did with what you did. So, looking at https://github.com/moodle/moodle/blob/master/mod/forum/backup/moodle2/restore_forum_stepslib.php#L34
Well, that is an activity module, that ends with
return$this->prepare_activity_structure($paths);
But, you are working on a local plugin, which I guess is different.
Sorry, I can't see anything obviously wrong.