Here you find the command to remove the kernel 7.0:
For the 6.17 kernel it should be similar with the numbers of the 6.17 kernel you want to remove (6.17.0-40).
The 6.17 kernel has also modules-extra, but when you remove the other parts, the kernel should no longer work.