Not really a bug - but an inconsistency in the UI..
In 'Detail' view, hitting the P or X key to pick or reject an image sets the appropriate flag.
Hitting the OPPOSITE flag (eg: if you have already set an image to 'Pick', and then hit X to set it to 'Reject'), the flag instantly changes, as expected.
But in Grid view, hitting the opposite flag key doesn't immediately set the flag - it turns the other flag OFF, so you then have to hit the desired flag key again..
Eg: Pick an image using the P key in grid view, then hit X - the pick flag is removed but the image now has no flag set - needing an extra press of the X to reject it properly.
It should immediately set the flag to rejected (or vice versa) when pressing the relevant flag shortcut, not toggle the existing state to off - thereby matching the behaviour in the Detail view.
The flag should only be toggled to off if it's the same key shortcut as the existing flag - ie: if the image is already flagged as 'Pick' - then hitting X should set the flag to reject, and hitting P should toggle the flag to off, or 'Unflagged'.