They did a pretty good job in persuading people to use search, adsense, YouTube, Gmail, Maps and a bunch of other products.
Singling out a few couple of the less successful ones to claim a trillion dollar company is “clumsy at persuading people to use their products” seems like a pretty bad take.
You'll note that all the examples you're citing were released more than a decade ago (search wasn't even this century!). And YouTube was an acquisition. They were basically the work of a different Google to the one that is walking around now.
The stereotype of Google back then was very different. People would quote things like "don't be evil".
The only products you listed which weren’t acquisitions are search and gmail. Search is exactly the problem Google was made to handle and Gmail.. well I don’t love gmail but it is a good enough product I guess?
But whatever their code quality may be, luring in devs to their API has seen hits and misses.