The source of the problem here is that, with Razor, each user session gets its own service scope. This means that Scoped -and even Transient- instances will be kept alive for the duration of the session. While these Scoped and Transient services will be isolated per user, they can live for hours (or even days) depending on how long the user is keep using the site. Services are reused across all requests the user makes.
And here lies the problem, because users are not guaranteed to work with the application in a single-threaded way. It's easy for the user to make a second request to the server, while the first request is still running. This is a problem for things like Entity Framework's DbContext instances, because they are not thread safe. The error message you got is an indication of this.
Not that in this respect, it doesn't matter whether you inject a DbContext directly into your pages or whether you inject the DbContext deep down into the dependency graph. The DbContext will still be cached.
Besides thread safety, there are other issues with keeping a DbContext alive for that long, because DbContext will cache entities and those get stale over time. Changes from other users won't be loaded for entities that were already cached. This will lead to pretty bugs that will never show up during debugging and are painfully difficult to find after bug reports are coming in.
The solution is to prevent DbContext instances to be injected into a part of the object tree that is kept alive for the duration of the session. Instead, during every request a new service scope needs to be created manually and from this scope you should resolve the service(s) that depend on the DbContext. This way, the DbContext is guaranteed to live for as long as a single web request and never longer.
How to efficiently fix the issue is hard to say, because it depends on the design of the application. However, if you're willing to adapt a different application design, the on design that has saved me tons of headaches over the years and also efficiently fixes the issue you are having is what I call the command/handler and query/handler patterns.
Using those patterns you route all calls through the same abstractions. This allows you to put some infrastructure in between the consumer (your page class?) and the dependency (the handler) that ensures that the dependency tree for the handler is always resolved using a fresh service scope from the DI Container. As your handler (or one of its dependencies) will depend on DbContext, this ensures that the DbContext's life ends with the web request.
There's a lot written about this kind of design and you could also take a look at library's such as MediatR that provide you with interfaces that serve as a starting point and provide integration with MS.DI by default (unfortunately, MediatR is only free for small organizations). Only thing is that I don't think that MediatR will start a new service scope for a dispatched command, but this behavior should be easily to adapt.
services.AddDbContext<...Andservices.AddScoped<IMyService, MyService>();