I was basing it off the fact that posters were mentioning that rent for the OP would more than 5K a month. In 3 years, that is 180k in wasted rent. Way more than required to justify any closing costs etc.
Obviously, if OP doesn't have enough for a down payment, or not eligible to be approved for a mortgage, then this won't work for him.
OTOH, after seeing this past weeks mortgage rate huge jumps, I might have to retract my suggestion