If you decide to redefine sex as a collection of traits, the problem with that is it's dependent on the specific developmental mechanisms of each species. Then the question is, how do you decide which traits are female and which are male? Especially in as yet undiscovered species. And how to classify species where each individual is both male and female?
The answer to all of this is to remember that sex is about reproduction, so it must fundamentally be based on gametes.