That’s quite an old kernel version, 6.18.5 and still from F42, while F43 is on 6.18.13. And from your qt5-qtbase-devel, it appears you are indeed on F43. So dnf removing an old F42 kernel doesn’t surprise me much.
Which is quite a bit. I just recently installed fedora 43 and thought it went right. Maybe I should try uninstalling some and maybe when I try to install certain packages it prompts to remove old kernels?
On a default Fedora install, this should say “installonly_limit = 3”, i.e. 3 kernels simultaneously installed. If so, then it’s not too surprising that dnf tries to remove the oldest of the 4 at every opportunity. (Though I’m not sure how you would have ended up with 4 kernels to begin with.)
If you have more than installonly_limit kernels installed, dnf will remove the oldest one after a transaction. In your case, the 6.18.5 kernel fits that.
What error are you referring to? What I saw in your post seems to be normal dnf behavior. It’s printing that it is going to remove the old kernel as part of the current invocation, at which point you aborted. Or am I missing something?