Because of the first-class spans feature in C# 14, MemoryExtensions.Contains gets resolved instead of Enumerable.Contains; we reacted to this in EF Core and backported the fix to EF 8 and 9.
However, #35547 tracked an additional issue around the new overload of MemoryExtensions.Contains, which has an optional comparer parameter, and gets resolved with C# 14. This was fixed for EF 10 (#35547), but was not backported to EF 8 and 9 (which we don't test with .NET 10 / C# 14). So to fully support C# 14 with EF 8 and 9, we need to backport #35547 from EF 10 to those releases as well.
Thanks to @ChrisJollyAU for figuring this out (dotnet/runtime#109757 (comment)) and to @CypherPotato for reporting in dotnet/runtime#109757 (comment).