This is intricate issue: In short this is fixed in ardour-git (since 5.5-567-gddeaa6c52)
The long story: there is (or was) an ambiguity between the C++ boost::shared_ptr<PluginInfo> and boost::weak_ptr<PluginInfo> . Usually the type is implicit when using arguments. But in case of the constructor: The script created a weak-pointer, the function expected a shared-pointer.
Note that the API for do_import() has changed (allow to import tempo-maps from .mid) in recent git: