According to the opinion that beitzah shenolda b'Yomtov is forbidden for achilah on Yomtov,because the day before is Shabbos,and it was completed on Shabbos,and it is forbidden to prepare from Shabbos for Yomtov. Then Kal v'chomer,why can we eat an egg laid on Sunday ?How can Shabbos prepare for chol?How can we buy any egg if we don't know when it was completed or laid?
(a) Rashi relates to your question. He answers (Daf 2b, DH v'Ein Yom Tov Mechin, cited also in Tosfos DH v'Hayah) that the concept of Hachanah means, basically, that something which is not "prepared" (Hachanah) from a weekday, is considered Muktzah, and is prohibited to eat on Yom Tov or Shabbos mid'Oraisa. (See also Rashi 26b DH v'Iy d'Lo.) Only Shabbos or Yom Tov are "special" enough to have laws that require their food to be prepared, and not Muktzah. A weekday's food cannot be "Muktzah," so Sunday's meal does not have to be prepared. (In other words, the problem of Hachanah is not that the food was prepared on Shabbos , but that it was not prepared in advance from Friday .) This is Rashi's opinion.
(b) However, all other Rishonim reject this approach (see especially Ba'al ha'Me'or), and learn Hachanah as you seem to have learned; that the problem is that the food was prepared on Shabbos (before Yom Tov) or Yom Tov (before Shabbos). Shabbos cannot prepare for Yom Tov, so then certainly it should prohibit the food if it prepares for a weekday, as you suggested.
The answer is that the prohibition of Hachanah is not needed to prohibit a person from using Yom Tov to prepare for the weekday. That is prohibited mid'Oraisa because of Lo Sa'aseh Kol Melachah (as Rashi puts it on Pesachim 46b, Beitzah 12a DH Lokeh), since Melachah that is not for Ochel Nefesh is prohibited on Yom Tov. Rather, Hachanah is referring to an item that was prepared "by heaven," on Yom Tov for Shabbos or v.v. That is, it came into being naturally on Yom Tov, such as an egg, but will not be able to be benefitted from practically until the following day, which is Shabbos. Hachanah prohibits using such an object b'Di'eved, after it comes into being, and has nothing to do with Meleches Yom Tov (or Shabbos). It is a Gezeiras ha'Kasuv that prohibits benefitting on one Yom Mekudash from what was produced on another Yom Mekudash (but could not be eaten that day), as the Ba'al ha'Me'or says; the Pasuk did not prohibit to eat what a Yom Mekudash produces on weekdays.
(If you want some logical basis for this Gezeiras ha'Kasuv, look at it this way. The prohibition is because it would "slight" the first day to make it look like it was being used to simply prepare food for the second day, which could not even be eaten on the first day itself. It does not slight a day to prepare food for itself, so had the egg been completed on the day it was laid it would be permitted. Neither does it slight the day to eat its produce on a weekday, for we do not "prepare" weekday meals for them in advance. Therefore nobody will mistakenly relate to the laying of the egg on Shabbos as a "preparation in advance" for a weekday; it was just coincidentally completed on Shabbos.)
Hope this is helpful,