It looks like you’ve misinterpreted the use of some of the wires, but this is the way I interpret it.
For the switch box, you have a 14/2 coming in with power and a 14/2 that leaves with constant power to go on to the next outlet or light in the circuit. One switch provides switched power to the black wire on the 14/3, and the other switch gives switched power to the red.
In the fan box, the tedred wire is connected to the black in the 14/2 which travels to the other light in the room. The black wire is what supplies switched power to the fan and that’s why it is not hooked up.
So, the fan will connect to the black wire for power, the white wire for neutral, and the grounds will also need to be connected.
If you need more clarification, let me know and I can edit this with more detail later.