I don't think the author means to claim that $(X,i_*(\mathscr{O}_X\vert_U))$ is a locally ringed space. He says that if $X$ is a locally ringed space then the map $i^\sharp:\mathscr{O}_X\to i_*(\mathscr{O}_X\vert_U)$ he's defined is a local homomorphism, but what he means is that the stalk maps $i_x^\sharp:\mathscr{O}_{X,x}\to (\mathscr{O}_X\vert_U)_x$ are local homomorphisms for each $x\in U$. And this is true: these maps are isomorphisms.
In fact for any ringed space, the stalk maps above are isomorphisms, which makes it clear that if $(X,\mathscr{O}_X)$ is a locally ringed space, $(U,\mathscr{O}_X\vert_U)$ is too.