I am not completely familiar with the submodule API, but I think the usage of the `name` parameter is not quite right. The `name` of the submodule looks to be the path of the submodule. If the `relativePath` parameter is provided, then the name parameter is not used in the creation of the submodule, and the lookup on `name` will not find the submodule.

Maybe this method only takes a `path` parameter?