There is one very good writing by Ian Mitchell : https://www.scrum.org/resources/blog/projects-and-products-scrum . I have a question related to same topic.
Imagine you are currently working on Sprint A with Goal A
You have planned for an upcoming sprint that is Sprint B with Goal B
By the end of Sprint A, you realized there are some undone tickets that satisfy Goal A which will take 1 week of time to be DONE and assuming these are still very high priority tickets.