It may, but not simply because of nodes connecting and disconnecting. By default a node will only relay a transaction when it first learns of it. If your node goes offline and comes back online, it doesn't rebroadcast its mempool. Your node will only rebroadcast your own transactions, not its entire mempool.
Thank you for the ample clarification. I didn't know that only newly received transactions are being relayed. I used to think that a node will relay all the transactions it has in its mempool to any new node that connects to it. That's why I was wondering what's the need for the "
mempoolexpiry" parameter in the "
bitcoin.conf" file! Now it makes more sense.