Maybe you could try those "2-in-1" shorts? Instead of a mesh liner they have solid fabric "underwear" sewn into the shorts themselves. Unless these are the ones you're wearing right now.
I also wonder if you bought Patagonia shorts (they only have mesh liners, not full spandex) and then brought them to their repair program (check if you have their store locally). Not sure if they'd replace the liner for you, maybe ask their customer support
I mean something like this: https://www.gymshark.com/collections/2-in-1-shorts