I heard that part of the motivation behind games like Pokémon Go is that they can collect data on previously unrecorded pedestrian routes between major landmarks or points of interest.
So Google’s directions may be based on crowd sourced routes that have never been vetted as safe/legal for pedestrians and cyclists.