Joining and then leaving the monastic order?
I do not recall any suttas that refer to a bad outcome due to disrobing. This said, I do not recall any suttas about a monk returning to lay life given the Buddha generally intervened and prevented them.
However, the suttas do have teachings I recall about bad monks, such as the Dhammapda verses below:


There are many evil characters and uncontrolled men wearing the saffron robe. These wicked men will be born in states of woe because of their evil deeds.

It would be better to swallow a red-hot iron ball, blazing like fire, than as an immoral and uncontrolled monk to eat the alms of the people.



As for good rebirth, this can only come from general good karma (rather than a token amount of time as a monk). For example, in Thailand, often corrupt politicians temporarily become monks to redeem their reputations. However, if they are inwardly rotten, ordaining temporarily won’t help much change their destiny.