Google maps uses gtfs, public transport companies publish that feeds. Osm does not store this data, only subsets were imported, mostly the physical stuff, stops, stations and sometimes lines.
For proper public transport routing you need a service where this feeds were imported or linked correctly, and they can combine it with osm data for alternatives.
I used this osm based app a long time ago, I don't know if it's still working: https://transportr.app/
The problem with that is that for planning public transport routes, you need to store public transport timetables. This raises not just questions about how to store them in OSM's data model, but also copyright concerns and concerns whether this kind of data is even in scope of a geographical database.
There are quite a few frontends for OSM that let you plan routes, like OSMAnd~. There's one that I can't remember the name of which lets you choose profiles based on your mode of transport.
If you find that details are missing, you can use apps like Street Complete and MapComplete to fill in the blanks 👍
I haven't used that one. I've checked, and it's OSMAnd~ and Organic Maps that have those options.
It's a good thing that I checked too, as I found out that some of the pavements / sidewalks in my area don't seem to allow cycling, when there shouldn't be a restriction, and the walking routing seems to take a longer route now and then.