The shader syntax has been added to since 2018, but the code written in 2018 will to the extent of my knowledge work fine today, Since your code is not identical to the one in the tutorial(in which case it would do the exact same thing), you may only be of by a minus sign, which will throw your math of, it has happened to me many times :). That fact in combination with the fact that mathematical algorithms are horrible to debug makes shading one of the most difficult parts of game development. I will leave you with some of my techniques that I commonly use to debug shaders:
Try to analyse mathematical patterns in your errors, i.e if the grass is constantly appearing 1 meter above the ground then a one maybe should be a zero, or vice versa. If it follows some other mathematical formula, I'd look for that in my shader. I'd try to render them in one solid colour, in order to check whether it's the vertex coordinates that are off or the UV's of the particle. Another thing I'd try is to check whether the generated UV's from where you sample the height map is correct by simply colouring each fragment in the samples colour, that way you know that that scale is correct. Another thing to check whether the amplitude of the terrain is equal to the one generated in the shader, aka, the terrain and grass may line up at some height but not at another.
Those would be the first checks I'd do, they will help you narrow down your search to something manageable and will hopefully you get a good understanding of the problem you're trying to solve with your debug. as always working with shaders, you really can't get any printouts in the console, ensuring you've done right, but are left to visual debugging, which takes some time to get used to, but don't give up, you will solve the problem sooner or later!! If you run these tests, come back with your code and what the problem is I probably can help you better, but as usual there is no fit-all solution to shader debugging, but I hope I have given you some advise on how to wrap your head around the problem. You are quite welcome to come back to hopefully get more substantial advise once you figure out in what way they differ from the terrain, but given the info you have given, there are simply a million things that can throw those strands of yours of course!!