Upon replication I was not able to observe the same behavior when using merge-pull-request-by-three-way (via console and cli) specifying the pull request that was created to merge from the dev branch into integration, the end result is that the code is merged only into integration and not in master branches.
You can try this once via console and check if you are still observing the same behavior.
If you are still observing the same you can open a support case with the CodeCommit team to further investigate the issue as we would need to check your environment to find the root cause
Block read access to a branch in a CodeCommit Repositoryasked 22 days ago
Can two servers connect to the same AWS CodeCommit repository?asked 3 months ago
Is codecommit cli and sdk command for get-file and get-folder deprecated?asked 3 years ago
CodeCommit merge-pull-request-by-three-way merges by commit-id rather than branchasked 2 months ago
Does CodeBuild support cross-account access with CodeCommit?Accepted Answerasked 4 years ago
How to use codecommit submodules in CodeBuildasked 6 months ago
CodeCommit - notifications for author of PR'sasked 6 months ago
Pipeline trigger on pull requestasked 7 months ago
Pass CommitId of a CodeCommit tag to CodeBuild projectasked 3 years ago
Pull requests wrongly marked as "Merged"?asked 4 months ago