Ports allocated from the wrong source
Deriving an answer from a record of what you think exists, rather than from the machine.
The allocator took the highest port in the table and added one. It was correct for a year, and then it was not, because a real process was listening on a port the table had never heard of.
A record is a claim about the world. The world is the world. Anything that has no consequence for being incomplete will eventually be incomplete.
Read both. The live listeners catch the process nothing recorded; the table catches the site provisioned three seconds ago that has not started listening yet. Neither alone is correct, and a check that cannot see must refuse rather than guess.