Strongly agree that this is NOT a failure. Most peopl who lose a significant amount of weight do go off plan occasionally - well, I know I do, at least, and even after all this time and all this weight, still more often than I'd like! But the measure of success isn't perfection and flawless adherence to your plan in all circumstances. Rather, it is consistency - getting right back on plan as soon as the eating opportunity that tripped you up passes.
You are remaining conscious of what you are doing and you are getting right back on track. That IS success. Just keep doing that and the weight loss will follow in time.
You may even be surprised at how forgiving your body is. You say you were "okay but not great" with controlling your eating. Think back to how you might have handled these same eating opportunities in the past, before you went on plan. You have probably eaten a lot, lot less than you would have in the past. That, too, is a success.
Be proud of yourself, learn from the experience, and above all, dust yourself off and get right back on plan.