So far I'm able to create the Record Type for an object using Java.
For the object requiring only 1 Record Type using Java: (the upserts are going fine) - If I'm to create only one record Type per object then it executes right. (e.g from the user input accepting the Record Type name to be created for any object, then it is updated for the logged-in user's profile to make it visible, after that the upserts are performed by using the RecordTypeId and it goes fine - Tested for each object in concern).
For the object requiring more than 1 Record Type using Java: (any upsert leads to an error) - If I'm to make multiple Record Types from Java (e.g I'm able to make them created as well as successfully updated on Profile but during upserts I'm getting the Error INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY:insufficient access rights on cross-reference id )
Solution: (Manual updation of Profile)
One workaround I found for this: If we go to Profile --> Record Type Settings --> Edit (Object name) and again save without doing modifications, thereafter if we perform the upsert operations it goes fine.
These all operations are automated using Metadata API of Salesforce from Java.
Can you let me know if I'm doing anything wrong or there could be any other way around? So, that this Manual updation can be removed.