While following the video, I accidentally found out that if you put all the nodes you duplicate at 22:18 into a node group and then duplicate the node group, the nodes inside will keep their animation data. I made the duplicated node group a single user before I offset the animation and it looped correctly. I used Blender 3.3.1.