Question about the move h5 I recently played a chess game whose link is:
https://lichess.org/pCFw1h2w/black#5

After running a computer analysis, I found that in this position:


I know that even though Stockfish does not tell me so, up to the 9th move,  I made several small inaccuracies among which the 6th move ( 6. ...Bg6) which I think was worse than 6. ...Bh7.

Now here is where my question arises.

On the 8th move I did not play 8. ...Ne7 yet because I thought that then White would play g5 and the great square f5 for my knight would be off-limits. So I played 8. ...Nd7 first without committing to anything yet.
Now on the ninth move I would like to move my knight to e7 (with the idea I mentioned before). So what I played was 9. ...h5 in order to prevent g4 from White. However, Stockfish says h5 is not a good move. Why?

I an unable to understand why according to Stockfish I could directly play 9. ... Ne7 and White's expected answer 10. g4 is marked as a mistake, which I cannot explain. The line which is given for Black does not provide a good square for Black's knight on e7 (which remains stuck there) and yet Black has an advantage. Why?
f5 is a decent square for your knight, but it is not doing all that much from there either. Ok, it is attacking d4, but that pawn is overprotected by knight and queen, so nothing to worry about for white.

I am not a Caro-Kann player, but I believe a much more natural plan is trying to push c5 exchanging the d4 pawn after which the pawn on e5 gets weak.

Even if you get in Nf5 first, I don't see how you would proceed without playing c5 as black.

Regarding the move h5. Yes it does prevent g4 for the moment, but it also weakens the square g5, which can be occupied by white knight and bishop. For instance after h5 castling short is almost impossible for black, because after white Ng5, Qh7 mate is very difficult to prevent.

After Ne7, immediate g4 is not good, because 


it weakens the white king
it only prevents Nf5 which is not all that dangerous anyway (see above)
if you want to prevent the black knight from occupying the square f5, you could just wait until black moves Nf5, then play g4 and you would gain a tempo, because the knight would have to retreat to e7.