Is this sentence grammatically correct? (Concerned with the usage of "have less to do with")

I agree that it's a bit awkward. I think that stems from comparing "having to do with" and "serving as".

I think "solitude" here has less to do with being a reference to loneliness and isolation, than with serving as a prerequisite for recollection and reflection.

Or perhaps even better:

I think "solitude" here serves more as a prerequisite for recollection and reflection than as a reference to loneliness or isolation