Assuming that your solenoid does indeed draw 7A at steady state when powered from a 24 volt source, then it has a resistance of about 3.5 ohms. As soon as the current in the power circuit is interrupted, the inductance of the solenoid coil will cause a negative voltage at the switched end of the solenoid, relative to the ground, according to the formula V = L ( di/dt ). For this inductance voltage to be negative, di/dt must be negative, in other words, the current through the inductor is reducing.

Without the diode, di/dt becomes arbitrarily large, and the voltage at the switched end of the inductor can go negative several hundred volts, which can cause the switch ( in your case, the relay contact ) to flash over if it hasn't openned fast enough.

With the diode, as soon as the induced voltage at the switched end of the inductor falls to about -0.7 volts, then the diode will start to conduct. The current occuring in the diode loop, reduces the negative value of di/dt, which reduces the tendency for the voltage at the switched end of the inductor to become large and negative. The current in the loop consisting of the inductor and the diode is then limited by the resistance of that circuit path, which is at least 3 ohms.

At all material times in this switching off process, di/dt is negative, and the current flowing through the inductor from either of the possible loop paths will be 7 amps, and falling.

If 7 amps is flowing through your inductor when you interrupt the power supply loop, then the peak current that will flow through the diode will not be more than 7 amps, at any instance in the turn-off process. People are uninformed, confused and delusional if they think otherwise. The opportunity for a potential of several hundred volts to appear at the contacts of the switch is correct, but that does not mean that a high current will occur there, either. You can have a spark with a very small current if the voltage is high enough. It is the negative potential caused by the inductance which causes the problem, and this negative potential only exists while di/dt is negative, that is, the current is falling.

You need to understand the difference between power and energy dissipation. The energy which existed in the magnetic field has to go somewhere, and it gets removed by the resistive losses in the inductor-diode loop. This loss of energy occurs mainly in the series resistance of the coil. If the solenoid coil is capable of dissipating the resistive heating losses from a constant current of 7 amps flowing through it, then it is not suddenly going to overheat from the resistive losses of less than 7 amps flowing through it.

From the point of view of components overheating, the heating depends on the power of the heating and the duration of the heating. From the point of view of accumulating heat, a heating effect that lasts a few milliseconds is inconsequential [ although you might have to consider other effects, like insulation breakdown ].