People apologize often on a tennis court. They say sorry to their doubles partner, to their imaginary parents, even to their coaches. On average over 70% of our self talk is negative. If we dig deeper into that stat, half of people have shame thoughts more than 70% of the time and if you are way above average you still frequently have bad things in your brain. Negative thinking can actually be quite helpful when managed properly. Seeing the possible damaging consequences of our actions ahead of time helps us to avoid or preemptively solve problems. However if or thoughts destroy our peace, calm and/or confidence, then we have a problem.
The vast majority of players I work with entertain maladaptive thoughts. They use subjective judgments, create very demanding expectations of what is acceptable performance, and generally beat themselves up for missed shots. One of the most damaging notion players beat themselves up with is the idea of "Consistency". It sounds good, but it leads to an obsession with not ever missing, because every missed shot means a lack of consistency. Instead, people should focus more on what they want to do, the shots they like, and risk:reward ratio.
The solution is not necessarily positive thinking, but objective observation. Simply understanding what's happening, and knowing what you like about your good shots enables you to know what you want, then execute it. If you know what you are doing, you can change what your are doing.