I find using hashtags doesn't work well on xhs, especially searching them.
The way that works for me is type the hashtag then the word until they all exist in grey, then for each one, select the text, choose 'cut', then paste it back next to the hashtag. It lights up blue.
But I do this right before I publish the note, because otherwise they sometimes go grey again.
E.g. Saving a draft puts them to grey again
I know this isn't quite what you are asking because you said they go grey after you publish, not before, but it might be worth a try given how finicky hashtags are.