Undo reverts to what the pattern looked like before you started modifying it. If you wan to create a manual undo point, press Copy+Enter before making your changes. That essentially commits all previous changes.
Thanks for the answer. The trick with the manual point works. So it’s good to remember it to avoid problems in Step program just after pattern copy.
Here is a video of the original issue (first half) and how to solve it (second half) with manual undo point. I leave it here in case someone has the same issue in the future.
For me, it is not intuitive to have to use a manual point in the above case but if it’s the only possible workaround I ll remember it
The workflow behind this is doing multiples copies of a main pattern and creating small variations by quickly adding or deleting elements in Step Program.