That warning was to simply remind that some moments when we iterate through a function and remove some elements from it, at the same time, it might cause some errors due to that.
In your case, such thing doesn't seem to have, the code is even working correctly and bringing back the expected result, but there are moments that doing such things will cause an error.
Last time I saw something like this was with a user who got a list from range(len(listName)). He was iterating over this list, generated by range, and removing specific elements. In that case, the error occured because you were making your list shorter, at least that's what I think.
Even if your code is correct, follow the instructions. Regardless if you want to follow or not, that's your only was to pass the lesson.
Have you tried doing the following ?
newList = oldList[:]
This will copy the values from the old list to the new list, other than passing the reference of a list to another.
Remember: whenever we use functions and we pass, as argument, a list we are passing the reference of it, which means that any modification that we do inside of our function with the list, will cause the original list to be also modified.
Hope this helps you understand why all of this!
If I wasn't clear or my answer wasn't enough, let me know and I'll find another way to explain.