CiviCRM allows the display of several contacts at once using multiple tabs. It appears that if several contacts are being edited simultaneously by the same user, then the data edited will be saved against an incorrect contact (ie, custom data entered when the form displays contact A will be stored against contact B).
I wrote this up as a forum post as I thought that CiviCRM was only displaying an incorrect contact after saving data, but then when I tested it more thoroughly realised that the data was saved to a contact other than the one displayed in the form.
I can't duplicate the behaviour with Membership data, so I think this may apply only to custom data tabs.
In order to duplicate this error, I think you need to view custom data screens for two or more contacts simultaneously. A fix may be to ensure that the contact ID is embedded in the custom data field, rather than obtained from session variables (if that's where it comes from currently).
Instructions for duplication are available in this forum post: http://forum.civicrm.org/index.php/topic,2807.0.html