Your kid waited until he was two to start throwing up when he doesn't want to do something? Or, more to the point, wants YOU to do something?
I don't mean to make light, but that's one of the oldest tricks in the book. Even kids younger figure out if they stick their fingers in their mouth far enough, they will gag or throw up and Mommy comes running.
Cause and effect.
I've known little kids that have thrown up at hearing the word broccoli.
Because they don't want to eat it.
It's hard to believe that a precious child can be that manipulative, but they can. And, in all fairness, they don't have the capability to pre-determine a manipulative behavior. They do something, they get a reaction that is pleasing or beneficial to them in some way and they learn what works to continue getting it. So that's what they do.
Your two year old thinks HIS bedtime is YOUR bedtime.
He is two. You are not.
He does not determine when you go to sleep or lay down and he also should't determine where you do it.
Deal with the constipation issues.
But, that has nothing to do with the fact your son is fine all day long until it's time for him to go to bed. All by himself.
He doesn't have the flu. He's not sick or he'd be barfing all day long.
It really is my guess that he knows if he throws up, he can drag out bedtime and you will lay down with him or whatever because our babies throwing up is so horrible.
It's not horrible for them if it serves a purpose.
Try not racing to him or even responding to it.
He does it when you try to leave the bedroom?
Just leave anyway.
"Good night! I love you!"
Close the door.
If he's throwing up in YOUR bed, I'd say it's time for him to have his own.
He can throw up in his own bed as much as he wants, but he's still going to bed. When you say. And YOU don't have to go to bed with him at the same time.
His life will not end because of it. It really won't. You're not being cruel by letting him realize that.
You are obviously a very loving and affectionate mother.
You know nothing is harming your son by having bedtime.
Hang in there and be strong.
It's just my opinion, but the sooner you get him to sleep by himself, the sooner you will both be happy in the evenings.