This could indeed be future peeking, although I'm not 100% sure. In the old version the new trade would run in a new TMF loop, from the first to the last price of the bar. Because the first price lies in the past when the trade was entered, it is normally entered at a better price due to the later stopping out of the old, opposite trade. This won't happen anymore with the new version.

I'm not sure because I remember that the old version had a workaround for this case, otherwise entering trades in a TMF would be forbidden. But I'll look into this in more detail and test your script with both versions. I'll also check the reason for the exit after a minute.