As you say, complaining about teaching is generally considered toxic and can be quite off-putting.  But why do people do it? I have two short answers: incentives are not aligned, looking for a connection with others. 

Promotion, school rank, and influence depend heavily on research. Teaching, while deeply satisfying and beneficial in a number of ways, typically does not lead to promotions. It also is important to being hired.  For an anecdotal example, [this new PhD received 6x the clicks on their research than their teaching page][1].  There's no doubt some self-selection going on but it is illustrative. 

As a result, Professors sometimes see teaching as something that inhibits their personal progress and career. There are great complementarities, however. Communication skills are critical for researchers, and repeated teaching of the same material gives new understanding. 

On the other hand, sometimes this is a common way of 'talking shop', some people are just looking to connect through complaining. This is perhaps a human instinct, but certainly not best practice. 


  [1]: https://thelittledataset.com/2022/03/21/job-mkt/