You are right, I didn't consider the huge variance on the candies found in the chests.Possible, yes but for many it won't happen.
Your calculation is based on receiving an average number of free candies when you open chests, therefore if everyone followed those numbers exactly, then about half are going to fail.
I wrote a little bit of code to simulate the number of candies needed to get 180 flags on a population of 10000 subjects.
- The chests offered are chosen randomly and every chest has the same chance to show up
- You always open the chest with the best candy-to-flag ratio in this order (best to worst): dark wood and gold/orange > purple > blue and red > sea green > light wood > green > bronze
- You start with 50 candies and get 100 more from the newsletter. You get 2145 from sequential quests and 770 from dailies. The total amount without the town pickups is 3065.
Here's the cumulative distribution function for the total number of candies needed to get 180 flags:
Here's the cumulative distribution function for the candy pickups needed per day: