Rav Yosef says: Come and hear a resolution from a mishna (Nidda 44b): A girl who is three years and one day old whose father arranged her betrothal is betrothed with intercourse, as the legal status of intercourse with her is that of full-fledged intercourse. And in a case where the childless husband of a girl who is three years and one day old dies, if his brother, the yavam, engages in intercourse with her, he acquires her as his wife; and if she is married, a man other than her husband is liable for engaging in intercourse with her due to the prohibition of intercourse with a married woman.
The mishna continues: And if she is impure due to menstruation, she transmits impurity to one who engages in intercourse with her, who then renders all the items designated for lying beneath him impure like the items designated for lying above him.
The mishna continues: And if one of any of those with whom relations are forbidden, who are stated in the Torah, engaged in intercourse with her, e.g., her father or father-in-law, they are executed by the court for engaging in intercourse with her, and she is exempt because she is a minor.
It's a thought experiment as evidenced by the question of what if the 3 year old is menstruating which is an impossibility. Additionally there are 3 places that say that this is not allowed.
Kiddushin 12b states:
The Gemara explains that Rav would flog a man for betrothing a woman in the marketplace, because this is disrespectful and crude, and for betrothing a woman through sexual intercourse, as it is unsavory to invite witnesses to observe a man and woman enter a room to engage in intercourse. And he would also flog a man for betrothing a woman without an arrangement [shiddukhei], i.e., if he did not discuss betrothal with the woman before betrothing her. Each of these acts is considered indecent behavior.
Yebamot 44a advises against age gap relationships
The baraita explains: Appropriate advice means that if he was a young man and she an elderly woman or if he was an elderly man and she a young woman, they say to him: What do you want with a young woman when you are elderly? Or: What do you want with an elderly woman when you are young? Go after your own kind, i.e., a woman of a similar age, and do not place discord in your household that could be caused by marrying a woman of a significantly different age.
Sanhedrin 76a explicitly says that age gap relationships will cause the woman to cheat and the father of a girl who marries her off young to an old man is considered to be responsible for her cheating:
“Do not profane your daughter by causing her to act licentiously”? Rabbi Mani says: This verse is referring to one who marries his daughter to an old man. Since she will not be satisfied with him, it will ultimately lead her to engage in adultery, and her father is responsible for causing that situation.
Marriage to an old man or a minor leaves the woman unsatisfied and is apt to lead to licentiousness.
Also you can't be married in Judaism as a woman at younger than 12 years old since you cannot sign the marriage contract due to being under the age of majority. When they bring up the childless husband of a 3 year old who dies, that's a logical impossibility.