I never worked for Google, but I do have fairly extensive experience with these kinds of situations. From that perspective, I assume there has to be more to the story for it to lead to a firing. In general, when a talented employee (like OP) does something like this, the response is usually something like: “We appreciate and love your initiative, and we want to encourage you to keep doing this kind of work. However,…
Given their manager was the one who announced their project I'm leaning closer to Google handling this badly? Which is understandable in an organisation so large tbh. Sometimes things are done badly, no one is perfect, especially not large organisations.
We're in a pretty messed up place in society if we hold individual people to this much of higher bar than a multi-trillion dollar company