From what you say, you are first calling up the entry from the database for 'tilapia,cooked, dry heat'
Are you trying to edit the information contained there to make that a 'custom food'?
I think what you want to do is just click on 'create custom food' without doing anything other than that. Don't try to link it to the entry for 'tilapia, cooked, dry heat' in any way. Just create it and save it. I usually add it to my food log just to make sure it works as I think I entered it (then I delete it from my food log if I didn't eat it...)