For clarity, the top staff here shows the expected (and desired) behaviour. If you first enter the p separately, then re-open the popover for the hairpin, there’s no problem.
Seeing the different way the dynamics were highlighted inadvertently provided me with a nice additional datapoint: the bug only occurs when Link dynamics and slurs to existing items when pasting under Preferences > Note Input and Editing is switched off.