I agree with all of this. I wrote a book for Packt many years ago (2005-ish?), and I was kind of underwhelmed about the whole experience. The editors were not native speakers of English, and introduced grammatical errors into the book. They published the wrong version of chapters I submitted. (Things would be revised after feedback from editors, I would revise later chapters for continuity with future chapters, etc.) Their editorial oversight basically made me look like an idiot. I could have done better on my own. (I got 3 stars on Amazon, and basically deserved that rating.)
They also changed the terms of payment at some point. I used to get quarterly royalties via Paypal, but they wanted to switch to European bank transfer or something. That is impossible for people based in the US, and they just didn't seem to understand that. It sounds like something I could have sued them over, but the book was definitely past its prime at that point, so I just said "remove my name from the book and don't contact me" and that has worked out pretty well so far. (I think someone else did a second edition. Good for them!)
It was nice to be forced to write an entire book. I signed a contract, got an advance, and delivered it. Today's me would just tell users "read the source code if you have questions", but a book length tutorial was probably good for the project in general.
If you have the mental energy to write an entire book without anyone pushing you to complete it, I think you'll enjoy the enhanced control that you get by self-publishing. Collecting money for PDFs is a solved problem, and honestly, PDFs are a lot more useful than printed books anyway. It is always "neat" to show people a printed book that you wrote, but I'm not really sure that's worth the downsides. I buy programming books, but I haven't gotten a printed copy in years. They just live on my computer, where I'm actually doing the programming.