At GET 2026, when discussing the problems we had matching GTFS an OSM routes, a colleague suggested us to take a look at https://github.com/matsim-org/pt2matsim, as they have had the same problem (implemented in Java).
We should take a look at it and eventually get ideas to improve our match algorithm.