Copying debian directory from another branch to build in Launchpad

The error is that you used the wrong branch name in the nest-part line. (The first argument to nest-part is a name that can be used to refer to that part of the recipe in substitution variables, not a Git branch name.) While the error message isn't the clearest thing ever, you can spot it by looking at this line in the build log:

fatal: Not a valid object name 574660454b66b1c1fd22e72c0ac2d1041e0a4b4d:debian

574660454b66b1c1fd22e72c0ac2d1041e0a4b4d is the current commit on the master branch, and that error message is saying, accurately, that there's no debian directory in the tree referenced by that commit.

You should have written the following instead, which seems to work as desired when I test it locally:

# git-build-recipe format 0.4 deb-version {debupstream}-1~{revtime}
lp:cozy master
nest-part deb-packaging-juno lp:cozy debian debian deb-packaging-juno

Or perhaps you might want to use a different name for the first argument to nest-part to reduce confusion:

# git-build-recipe format 0.4 deb-version {debupstream}-1~{revtime}
lp:cozy master
nest-part packaging lp:cozy debian debian deb-packaging-juno

While I could not copy the debian directory this way, I found an alternative, to merge the branch into master.

The current deb-packaging-juno directory cannot be merged into master because they were from the same base, and there were merge conflicts (However, this is probably not related to the failure in copying the directory, as mentioned in the question).

I created a new orphan branch (so that there would be no common history) named deb-dir containing the debian directory, and I am able to copy it into master with the following recipe.

# git-build-recipe format 0.4 deb-version {debupstream}-0~{revtime}
lp:cozy master
merge deb-dir lp:cozy deb-dir