Short answer: Unlike FlixBus (shown as the green line on the map), BlaBlaCar Bus (shown as the red line) only defined the location of their stops and not the detailed coordinates of the road their bus is running on between the stops. Hence, Google Maps rendered the route as piecewise as-the-crow-flies segments.
Long answer:
The big(ger) picture
The section uses the mobile version of Google Maps as it provides more visual information than the web version.
When one searches for a public transport trip between Genoa and Nice Airport during some (niche) times of day, Google Maps will suggest a BlaBlaCar Bus service. For example, searching one when leaving at 01:20 on 2025-04-13 yields:

Expanding the details of the service twice, we can see the bus originates from Frankfurt from the day before, calling at various stops, then Zürich > Milan Lampugnano > Genoa Via Fanti D'Italia > Nice - Airport Bus Station Terminal 1 > Cannes - Place Bénidorm > Toulon - Bus Station:

There are no local stops in between those named above. Notice how Google Maps renders the red line segment between each stop as a straight line. Clearly, they don't follow any road trajectories.
This is not the case if you check the FlixBus route (shown in green). While the bus also runs non-stop between Genoa and Nice Airport, the route is windy, following the road it runs on.
How do public transport routes come by?
Before explaining why Google renders a piecewise linear BlaBlaCar Bus route (but a realistic FlixBus route), we need to understand how a bus route gets on Google Maps.
Public transport operators can publish their stops, routes, schedules, etc., via the General Transit Feed Specification (GTFS). This is an open standard, with the resultant data being picked up or shared with map services (Google Transit being the latter).
The GTFS feeds for BlaBlaCar Bus and FlixBus (EU) are available here and here, respectively. For other operators, an online search with the query "<operator> GTFS feed" should do the trick.
A missing data problem
Inspecting the GTFS feeds shows that as of 2025-04-13, the FlixBus (EU) feed contains a c. 300 MB shapes.txt file, while the same is not found in the BlaBlaCar Bus feed.
The shapes.txt file contains "rules for mapping vehicle travel paths, sometimes referred to as route alignments.". It is optional (but is considered good practice) to include.
Without such a file, there is no easy way for a map platform to know the exact route (in terms of map coordinates) a public transport service has taken. As such, they will resort to rendering a straight line between two stops.