I've tested this with `emacs -Q`, Emacs version 28.2
I'm 99% sure that I'm doing something wrong here, but I can't figure this out:
This is the scenario: I have one frame with two windows showing two separate dired buffers, let's call them A and B. A is visiting `~/testA/` and B is visiting `~/testB/`. In both directories, there is a subdirectory `foo/` that I want to merge from buffer A into buffer B, and it doesn't matter if the files within that subdirectory are overwritten (this is what I want to do). I mark `foo/` in buffer A by pressing `m` (`dired-mark`) and press `C` (`dired-do-copy`). I am prompted for the location that I want to copy to; I enter the directory that buffer B is visiting and press RET. Now, I am prompted for whether I would like to overwrite the destination directory, which is what I want. I press `y` or `!`, and then I am asked if I want to copy recursively. I type `yes` and press `RET`. Now the operation fails with an error like this: `Copy: [source-directory] to [destination-directory] failed: (file-already-exists File exists [source-directory] [destination-directory])`. This happens with `dired-do-rename` as well, but without the prompt about recursive copying and a slightly different error: `Move: [source-directory] to [destination-directory] failed: (file-error Renaming Directory not empty [source-directory] [destination-directory])`
EDIT: Some more details about the exact steps I can take to reproduce this:
1. open a terminal emulator
2. type `emacs -Q` and press enter
3. press `C-x C-j` (`dired-jump`)
4. press `+` (`dired-create-directory`)
5. type `testA` and press `RET`
6. repeat steps 4 and 5 but create a directory called `testB`
7. enter the `testA` directory by putting point on it and pressing `RET`
8. press `+` and type in `foo` and press `RET`
9. press `C-x C-f` (`find-file`) and type `foo/bar` and press `RET`
10. type something into the new buffer and press `C-x C-s` (`save-buffer`)
11. Copy the folder `~/testA/foo` into `~/testB` somehow, with the shell or with dired
12. change the text in `~/testB/foo/bar` to something else and save it
13. Try to copy the folder `~/testA/foo` into `~/testB` again as outlined above
14. Agree to overwrite with `y`
15. Observe that the command fails