That is not your fault. That is normal limitation.
Overlay is displayed above render.
Grid may be partially masked by cube; because Solid render of cube is taken into account to hide it.
But Cycles hair curves have no radius in Solid render as Strands.
Their thickness is only showed in Cycles render.
That is why Grid is visible, making Viewport weakness looking like a material transparency issue.
If it bothers you, you can deactivate Grid Overlay.
F12 Cycles render should be fine, without any transparency isue.
By default, Hair Curves primitive shapes for Cycles are Rounded Ribbons in
If you want 3D Curves instead, you have to change that, in Curves panel of Render Properties tab.
But if you are disappointed about hair material ; you have to explain how you obtained it ( principled shader or principled hair shader) and what result, you expected instead.