My procedure performed with all steps noted is as follows:
Ensure the secondary colour that you have selected does not have an RGB value of 255 255 255. The alpha value is not important at this stage.
Select an area with rectangle, lasso, or ellipse tool.
Move the selected area with the "Move Selected Pixels tool" (dark cursor) tool.
Press enter to resolve the movement.
Use the magic wand tool and select an area that wasn't selected. This should highlight the affected area with a contrary colour.
Sample an area where the selected area was previously at before moving with the eyedropper tool. The result should end up being the RGB value of whatever the secondary colour is, with the alpha set to 0.
These steps are performed entirely on one layer.
In the diagram, the mouse head has been moved outside of the diagram in the second panel. What I am selecting is the background area, and the unselected part is where the mouse head was previously. Sampling the unselected area with the eyedropper tool results in the differing RGB value.
Here's a more clear visual explanation on what has occured. The Primary colour in this screenshot was obtained by sampling the unselected patch on the left.