It doesn’t matter if your intention was the opposite of doing harm. Your advice was not good advice. Your experience with someone who had an eating disorder doesn’t give you the ability to intuitively diagnose everyone that reminds you of their situation as having the same disorder.
You’re making huge assumptions based on little information. Saying people are underweight or hardly eat anything doesn’t even come close to automatically meaning “eating disorder”. I’m underweight myself and eat very little, I’m not anorexic. If I feel chubby after a few days of binge eating, someone trying to make me stop thinking about it by distracting me like a dog isn’t going to help.
Again, I’m assuming your goal is to help so I’m not trying to be rude, but your advice is both making the issue out to be much larger than it probably is (saying she is anorexic/ bulimic while OP never used these words) while simultaneously suggesting he ignore the problem by distracting her. Even if she does have an eating disorder, as others have pointed out, saying things are “a trap” is not a healthy way to look at it, as someone reaching out for help is not doing so to put you in a bad position.