if you'd like I'm happy to share the source code with you. the way I do it is a bit scuffed and it's ultimately very buggy, but it works. I just had to make sure that when the replay fails, it fails in a safe way.
https://github.com/v4rii/BeginnersJam25
TL:DR is that every action the player takes (i.e. every time the player hits "confirm"), data about that action is packed into a tuple and added to a list.
During "playback mode", whenever the player is lacking commands, they check the next item in the pastActions list and perform that.
That should've worked, and it did 90% of the time, but it ended up desyncing a lot so i then slapped on a ton of bandaid fixes LOL