Had some friends that tried doing that about three years ago. They finally gave up (and moved) recently.
Gave away their 15-20 chickens, coop, fence, etc. IMHO, they are much happier now.
The cost of feed, mite treatment, lice treatment, bedding, vaccinations, etc were much higher than anything they claimed to “save”. And that’s not counting all the time and labor they put into it.
Found this with a simple web search: https://coopeduplife.com/backyard-chicken-egg-production-cost-statistics/.
Glad it worked out for them! I think the main reason “normal” people have trouble is that they don’t understand all the issues involved.
For example, my friends didn’t realize they had to de-lice and do other things for them. Also didn’t know to buy “laying feed” for them to be able to lay eggs.
If people want to do it as a hobby/pets/know where their food comes from/etc that’s great. Just realize what you are buying into.