Ok, so . . .
Box 1 - One 3-wire (that’s three conductors plus a ground). The black conductor is on the black (common) screw on the dumb switch (or at least started that way).
Box 2 - One 2-wire with the white bundled with other whites and the black connected to the switch. That black conductor was originally originally on the black (common) screw of the dumb switch.
Box 2 - One 3-wire with the black to a black bundle and the white and red to the brass terminals on the switch.
So Box 1 is at the end of the run since there is only one 3-wire involved. That’s the easy part.
Box 2 is going to take some diagnosing:
1 - In Box 2, remove the black wire from the 2-wire Romex and USING A METER, test between the black and the white neutral bundle to see if you have 120V. Test with the Box 1 dumb switch in both positions. This is either going to be the incoming hot or the Romex to your light.
2 - In Box 2, double check to make sure there are only TWO Romex attached in part to this switch. In referring to when this is in a working configuration with the dumb switch. It might help to put the old switch back and get it working. If you do in fact only have TWO Romex involved here, then that suggests that the light is between the two switches. The problem is that the way the 3-wire is wired doesn’t yet make sense to me.