Code monitors: refer to the correct ID when joining monitors
Created by: camdencheek
Fixes an issue where we would select the monitor based on the condition that its own ID matches its own ID. This did nothing, so made the filter ineffective.
Stacked on #38039
Test plan
First commit updates tests to demonstrate the issue, second commit fixes the issue.