what I've figured out so far is it has something to do with a server being added to the server list.
For testing purposes, I added an entry named 'local' with localhost on port 6667 as server.
When connecting to localhost using '/server localhost 1026' and then closing the connection from the server side, mIRC first tries to reconnect on port 1026, but any other attempts will be directed towards port 6667.
[19:38:11] *  Software caused connection abort
[19:38:11] * Disconnected
[19:38:14] * Connect retry #1 localhost (1026)
[19:38:16] * Unable to connect to server (Connection refused)
[19:38:19] * Connect retry #2 localhost (6667)
[19:38:21] * Unable to connect to server (Connection refused)
However, if I remove that server from the server list, it continues to reconnect on the correct port.
Using Version 7.59, btw.
I made a video on how to reproduce the problem:https://www.youtube.com/watch?v=csMV2Yb5SdY
Since I know what causes the error, this thread can be seen as 'fixed'. However, it might be a bug so maybe move it to the correct section.