YT's content isn't free. The majority of the income (55/45 split) from ads and Premium goes to the content creators. To compare, in 2021 Netflix had content acquisition costs of 60% of their revenue.
And then on the flipside, YT has a much harder infrastucture problem than Netflix. There's probably like 1000x as much content (both new and existing), and much more diversity in what is being watched. That means 1000x more storage and transcoding, and far lower cache hit rates.
(I've got no idea of whether/how profitable YT is. Just saying that if you're trying to reason about it via analogy to Netflix, you've got the directionality wrong on both of the issues.)