You are not wrong but even among biologists and geneticists there are differences of opinion and differences of context. If a mouse geneticist says they knocked out gene X they usually mean that they inactivated the production of mRNA from a specific gene “model”. If you were talking to Richard Dawkins he would have a much more expansive definition of a “gene” that would include a much longer sequence of DNA (many protein-coding genes) that remains in a particular state long enough to be selected for (or not) or to drift to fixation or extinction.
It is not quite right to say:
“a gene is … a heritable trait.” This definition equates gene with trait. Yes that is how Mendel thought about his results since he could only see and quantify traits. But there are still a depressingly large number of protein-coding genes without linkage to traits.
We are not generally mouse geneticists, though. We are assumably a proxy for the general public.
> It is not quite right to say: “a gene is … a heritable trait.”
This is a reality of communication you need to deal with: that's absolutely how people will interpret the term "gene".
> Yes that is how Mendel thought about his results since he could only see and quantify traits. But there are still a depressingly large number of protein-coding genes without linkage to traits.
From my perspective, from my exceedingly humble opinion, "heritable trait linked by reproduction and not culture" is absolutely how the public at large understands the term "gene". The fact that scientists cannot successfully link protein-coding to linguistically-bound traits is an issue that scientists will have to work around when communicating about the specifics of heritability, genetic determinism, and discretization of individuals. "Gene" is simply not a term you can reliably link to DNA in the popular consciousness and is likely not worth the effort or money to redefine.
It is not quite right to say: “a gene is … a heritable trait.” This definition equates gene with trait. Yes that is how Mendel thought about his results since he could only see and quantify traits. But there are still a depressingly large number of protein-coding genes without linkage to traits.