Headphone out isn’t identical to line out, but is generally close enough to be used for the purpose. This should be working with a minor degradation in sound quality.
First thing is first: have you plugged headphones into your laptop to make sure the headphone out jack is working? Assuming you have done that…
I suspect you are dealing with the laptop jack being a “headset” jack and not specifically a “headphone” jack. Headphone jacks are “TRS” headset jacks are “TRRS”. See the picture at the top of this.
On the PC side, the line in jack is probably just TRS… if it’s a line in. Is it line in or microphone in? A mic in jack could just be a TS jack.
Are you using a TRS to TRS cable to hook this up? Or a TRRS to TRRS? Or a TRRS to TRS? I’m guessing you tried the first - TRS to TRS. If that’s the case, I would give a TRRS to TRS cable a try. TRRS out of laptop, TRS into desktop.
Edit: actually, assuming you are using a TRS to TRS cable, I’d get this adapter: https://a.co/d/aSMseh4 Adapter plugs into the laptop headset jack, then your TRS cable goes from the headphone jack on the adapter to the Pc. Mic jack stays empty.
I think this is more likely to work than a random TRRS to TRS cable, as those cables can come in a variety internal wirings, so a random cable may not be dropping the mic wire (like you want) and instead be dropping one or both headphone wires.