In Meseches Nida 30b it says a child in not born until he swears that he will keep the Torah. He will be a Tzaddik not a Rasha. The question arises why do we make the child swear a person already swore at mattan Torah on Shavuos that he will keep the Torah and therefore the Shvua one swears before he is born is not chal as he is mushba ve’omed me’har Sinai

The Maharsha in Nedarim8a explains that despite a shvua is not chal on another shvua nevertheless he still swears to be mezarez the person to keep the shvua of shavuos. As we find a person can make a Shvua to be mekayem a mitzva in order to be mezarez himself. 

The Sefer Emek Yehoshua vol 1 pg 7 and in Sefer Ohr Hoagada vol 3 both say that a neder is chal on the object and has no shaychis to the person making a shvua. Therefore, a child that is born despite the fact the Gemara uses a lashon of shvua he is really making a neder that his body will be a tzaddik. Now the shvua of Shavuos will not be a contradiction to the neder one makes when he is born. 

Another tirutz could be that this shvua is around from before Mattan Torah and therefore this shvua came first and in a time when there was not yet mattanTorah hence it is chal first. But the question is why in today’s day and age where it is after mattan Torah we still have that shvua

Another tirutz is that at mattan Torah the Shvua was al yedei kfiya. We were forced under the duress of being buried under the mountain, to swear. But the baby swears he will do it out of love. 

Another tirutz is that the baby for his first thirteen years of his life he has no chiyuv min HaTorah and therefore he swears even during his time of being a kattan he will be a tzaddik. Which could be the reason why a kattan when he becomes an adult, needs to do teshuva on the aveiros he did while he was a kattan. Based on this the Emek Yehoshua says that shvua is chal since it came before he was mushba from Har Sinai

Another tirutz could be on chatzi shiur which is assur min HaTorah but one is not mushbave’omed from Har Sinai. So too would be issurim DeRabbonon which the Torah says Lo Sasur but is not a chiyuv min haTorah

The Maharam Shik says the kattan swears that he will make extra seyagim and gedarim not to be oveir on the Torah. 

May we all be zocheh to keep our shvuos both the shvua at Mattan Torah and the shvua at birth, and have a spiritual Shavuos