Why doesn't the fact we can force the continuum hypothesis outright prove the continuum hypothesis?
But the bijection $\widetilde f$ is not in $M$, that's the whole point. It is in $M[G]$. What you've shown is merely that for every model of $\sf ZFC$, there is a larger model in which $\sf CH$ is true.
To see that indeed $\widetilde f\notin M$, note that given any function $g\colon \mathcal P(\Bbb N)\to\omega_1$, there is a dense set of conditions $p$ such that $p\nsubseteq g$. Therefore by genericity, $\widetilde f\neq g$. If $\widetilde f$ is not equal to any function in $M$, then it cannot be in $M$.
(This is, more broadly, the reason why whenever a forcing is nontrivial, there are no generic filters in the ground model.)
The key here is that $G$ is required to be generic over $M$, and as a consequence $G \not\in M$.
As you've noticed, if you can make a model of ZFC which contains $G$ and which agrees with $M$ about what $\mathcal{P}(\mathbb{N})$ and $\aleph_1$ are, then in that model CH will hold. Forcing tells us how to build such a model, and hence shows us that given a model $M$ we can make a model where CH holds. That lets us show the relative consistency of ZFC+CH, but it doesn't prove CH.
Let me add a couple points to the existing answers:
First, there's a key point which has not been mentioned in the existing answers: it's important to note that generics do not always exist. We are only guaranteed existence when $M$ is countable. So the statement
Every $M\models\mathsf{ZFC}$ is a submodel of some $N\models\mathsf{ZFC+CH}$
isn't really true - we need to restrict to countable $M$s. Indeed, if $\mathsf{CH}$ is false in reality then there is some $M$ with no end extension satisfying $\mathsf{CH}$: namely, any model containing all the reals.
A couple side comments:
"Every countable $M\models\mathsf{ZFC}$ is a submodel of some countable $N\models\mathsf{ZFC+CH}$" is true - we don't need these countable models to be well-founded! This isn't obvious, but isn't hard to show and is a good exercise in "running all the recursions internally."
We can talk about forcing extensions of arbitrary models (and indeed $V$ itself!) via the Boolean-valued model approach to forcing. This is the approach taken in Jech, for example. However, while fascinating and important it's also in my opinion substantialy less intuitive than the poset approach.
Second, for pedagogical value let me give an example where the importance of $G\not\in M$ is more blatantly obvious, namely the Levy collapse $Col(\omega,\omega_1)$.
$Col(\omega,\omega_1)$ is the simplest forcing for making $\omega_1$ countable: it consists of finite partial functions $\omega\rightarrow\omega_1$, ordered by reverse extension as expected. Since for each $\alpha\in\omega_1$ the set $\{p: \alpha\in ran(p)\}$ is dense, a generic $G$ (or rather, the union of the conditions in such a $G$) is a surjection from $\omega$ to $\omega_1$.
More precisely, and restricting to countable transitive models for simplicity, we have:
If $M$ is a countable transitive model of $\mathsf{ZFC}$ and $G$ is $Col(\omega,\omega_1^M)$-generic over $M$ then $M[G]\models\omega\equiv\omega_1^M$.
But unlike $\mathsf{CH}$, it's obvious that we can't possibly have a "same model" phenomenon: there is no $M\models\mathsf{ZFC}$ such that $M\models \omega\equiv\omega_1^M$. So considering this example first may help you see why forceability cannot possibly imply truth in general.
Finally, let me end on a positive note. Despite the above, there are some times when the "forceability" of a sentence implies its outright truth:
Shoenfield's absoluteness theorem says that the truth of $\Pi^1_2$ sentences cannot be changed by forcing, so if $G$ is generic over $M$ and $M[G]\models\varphi$ with $\varphi\in\Pi^1_2$ then $M\models\varphi$ and vice versa (actually Shoenfield says somewhat more than this, but meh). But this phenomenon is in general rare.
For special models of $\mathsf{ZFC}$ we can get stronger absoluteness results. Specifically, strong large cardinal axioms imply greater amounts of absoluteness (e.g. if I recall correctly, if $M\models\mathsf{ZFC}$ + "There are infinitely many Woodin cardinals" then all projective sentences are absolute between $M$ and its generic extensions).
However, in general absoluteness is pretty rare and should certainly never be taken for granted.