The most important thing about setting a writing schedule isn't whether you keep to it. It's whether you avoid beating yourself up the times you don't keep to it.
Let's be realistic: nobody can stick to a fixed and rigid writing schedule all of the time. Be sure to leave room to for flexibility when planning out your writing schedule. And leave room for iteration and adaptation once you start following it.
Reward yourself if you meet your daily goal ahead of plan, and be sure to give yourself a big reward when you meet your goals over a series of consecutive days or weeks. The point is to establish a sustainable habit, not to get down on yourself and get discouraged.
We're only human. It's in our nature to goof off and procrastinate from time to time, and it's also in our nature to fail sometimes when we shoot for ambitious goals. Don't beat yourself up for it.