Let $M$ be a smooth manifold of dimension $n$. Let $U \subset M$ be an open subset such that the restriction $TM|_U$ is trivial. Let $N$ be a closed submanifold of $M$ contained inside $U$. Does it follow then that $TM|_N$ is trivial as well?
I thought this was a trivial result (simply take $n$ linearly independent sections over $U$ and restrict to $N$), until I played around with Stiefel-Whitney classes and got a contradictory answer.
In particular take $N$ to have codimension $1$, and $N$ and $M$ to be orientable. Let $N$ be not parallelizable. Then $TM|_N \cong TN \oplus \nu$ where $\nu$ is the normal bundle of $N$ inside $M$, and $\oplus$ denotes the Whitney sum. It can be shown that since $\nu$ is a line bundle and $N$ and $M$ are orientable, $\nu$ is trivial. Hence $w_i (TM|_N) = w_i (TN \oplus \nu) = w_i(TN)$.
But $TN$ is not trivial, so not all $w_i$ are zero for $i>0$ so $TM|_N$ cannot be trivial, a contradiction.
Clearly I made a mistake somewhere, either at the beginning with the $n$ sections or when working with the Stiefel-Whitney classes, but I can't spot it. Any help in pointing out my mistake would be appreciated.
EDIT: Correction from the discussion in the comments, in the second part, $N$ should have some nonzero Stiefel-Whitney class instead of being just not parallelizable. In this case, there cannot be such an open set $U$ containing it.