Copied files in the sidebar end up in the wrong directory

In the file view sidebar, if you use Command-C, Command-V to make a copy of a file, it should create a duplicate of the source file with the name filename copy. This does not always work.

It works fine from the project root. But if you try to copy a file in a subdirectory, the copied file ends up in the parent directory, and without the “copy” suffix, instead of landing in the subdirectory from whence it came.