I've also reported this bug on the forums, but I missed the sticky post saying reporting things here is better, so I'm posting it here too.
I have marked it as Critical because it affects our production release, leaving processes in an invalid state.
Attached is a zipped unit test project for 5.21.0. The issue has been introduced in 5.18 as it worked before then.
I'm also including a diff which fixes the problem for me. All unit tests continue working, of course. However, I don't know if it breaks anything else. But the change makes sense to me conceptually, according to what Tijs Rademakers remarked:
The multi instance construct evaluates the number of instances when creating the multi instance activity. So if you use a mutating list, it will still use the original values that were evaluated on create time.
With the current code, the number of instances is also evaluated when ending the execution, not just when creating it.