Any negotiated "deal" must be made with all bases being covered. It looks like you did not have legal counsel's advice about this, and that is likely where the problem lies. These types of deals are like contracts, but unless it has been accepted and approved at all levels, including the judge signing off, it may not accomplish what you had hoped.
In all matters legal, you need to be represented by an experienced attorney. If there is a solution to your current prosecution, a competent criminal law attorney will be able to help. Good luck.
The above "answer" is for discussion purposes only and is neither intended as legal advice nor to create an attorney-client relationship. An attorney-client relationship is not created until after an in person consultation and I agree in writing to provide representation. I am licensed solely in the state of Arizona. You should consult with a knowledgeable attorney in your jurisdiction.
You need to take the written contract, and go hire a good attorney and have him/her look at it and see if anything can be done. Ultimately, the most police can do often is recommend that charges not be brought as the result of cooperation.