The mapping was read multiple times from the `map` structure in that time the `map` value could have changed (set to -1). To stop this, the mapping is read once and set to -1 earlier to reduce the possibility to other threads performing the operation and changing the mapping value. Pull Request: https://projects.blender.org/blender/blender/pulls/123056