"Your Phone Companion" only works on unlocked phone I do not know if this is a bug or a feature, but it does not make much sense.
I have a Samsung S9, and I managed to connect it to my Windows 10 laptop. I can only start apps when my phone is unlocked, and this is annoying:

If I need to pick up my phone anyway to unlock it, I might as well just use that, instead of my laptop
Why should I waste electricity on two screens?

Is there any solution?
when laptop accessing some data from your Samsung galaxy mobile. Your mobile should be unlocked. Security features hinder access of phone. You can temporary disable screen lock.
And reduce brightness of the mobile so less battery will be used.