If the button is in the portal row you do not need the Go to Portal Row step. The copy step should be enough.
I figured it out. My script had a commit record in it that was causing the problem.
What rgordon said. Clicking a button inside a portal row puts you in the context of that row.
Question is: why do you want to copy a value? Write it somewhere else?
Then within the same layout, a simple Set Field  would do, or – if you need to change context – use the Set Variable / Set Field combo.
Try to regard the clipboard as sacrosanct, and avoid using copy/paste whenever necessary. Also, with SF / SV, neither source nor target field need be on any layout.