The following sutta quote shows that it can be in any order. There's no automatic cleansing of past bad deeds after taking triple refuge and the vow of the precepts.
"Now, Ānanda, in the case of the person who takes life... & holds
wrong view and, with the breakup of the body, after death, reappears
in a plane of deprivation, a bad destination, a lower realm, hell:
Either earlier he performed evil action that is to be felt as painful,
or later he performed evil action that is to be felt as painful, or at
the time of death he adopted & carried out wrong view. Because of
that, with the breakup of the body, after death, he reappears in a
plane of deprivation, a bad destination, a lower realm, hell. And as
for the results of taking life... holding wrong view, he will feel
them either right here & now, or in the next [lifetime], or following
that.
"In the case of the person who takes life... & holds wrong view [yet],
with the breakup of the body, after death, reappears in a good
destination, a heavenly world: Either earlier he performed fine action
that is to be felt as pleasant, or later he performed fine action that
is to be felt as pleasant, or at the time of death he adopted &
carried out right view. Because of that, with the breakup of the body,
after death, he reappears in a good destination, a heavenly world. But
as for the results of taking life... holding wrong view, he will feel
them either right here & now, or in the next [lifetime], or following
that.
"In the case of the person who abstains from taking life... & holds
right view and, with the breakup of the body, after death, reappears
in a good destination, a heavenly world: either earlier he performed
fine action that is to be felt as pleasant, or later he performed fine
action that is to be felt as pleasant, or at the time of death he
adopted & carried out right view. Because of that, with the breakup of
the body, after death, he reappears in a good destination, a heavenly
world. And as for the results of abstaining from taking life...
holding right view, he will feel them either right here & now, or in
the next [lifetime], or following that."
"In the case of the person who abstains from taking life... & holds
right view [yet] with the breakup of the body, after death, reappears
in a plane of deprivation, a bad destination, a lower realm, hell:
Either earlier he performed evil action that is to be felt as painful,
or later he performed evil action that is to be felt as painful, or at
the time of death he adopted & carried out wrong view. Because of
that, with the breakup of the body, after death, he reappears in a
plane of deprivation, a bad destination, a lower realm, hell. But as
for the results of abstaining from taking life... holding right view,
he will feel them either right here & now, or in the next [lifetime],
or following that.
MN 136
However, the suttas do speak of stream entry as the point after which one definitely does not go to lower worlds.