The 'Collection was modified; enumeration operation may not execute' error from Semantic Kernel on .NET was a runtime-version problem: the reporter was on .NET Core 3.1, which is out of support. On .NET 6, 7, or 8, mutating the dictionary in that code path is fine (the key always exists, so the dictionary doesn't grow). If you hit this, upgrade your runtime; it stays an issue only on .NET Framework.

_Source: gh:microsoft/semantic-kernel#6058 (Semantic Kernel)_