I faced a similar problem recently with xml document type. I always got the agreement not found error with document type xxxx--null-INBOUIND. The issue was resolved after I exported the entire MDS repository, purged all the mds data and instance data and imported the repository back. It started working fine.
Thanks for your reply Ismail. I have done the steps suggested and I see no difference. I still see the same error. We are not specifying the document version in the TA1 file and the only place we are specifying the version is in the TA1 file name. So it is clear that the version is not picked from the File Name, so how do we give the version and document names for the inbound TA1 to pick the right Agreement??? Thanks---
Finally!! I am able to resolve the problem!!! So, as per my understanding TA1's generated and consumed are based on 5010 version only. So created new definition for TA1 under 5010 version and new set of Agreements, which solved my problem.