Swift is only a communication protocol it doesn't solve the clearing problem.
The clearing problem is really at its core about avoiding to move cash and how to transfer debt between two entities that don't know (and trust) each other, as far fetched as it sounds.
When you transfer $1 to a friend of yours that is at another bank, your bank owes you one less dollar and your friend's bank owe him one more. But aginst what? The promise by your bank to pay it with a physical dollar (or some other better debt) in the future. But if you are with a small bank, your friend's bank might not trust it. So the they use a bigger bank that both trust that act as an intermediary and that lends for a very small rate as it is a 100% collateralized debt. This is the definition of clearing.
Swift is a communication protocol to move digital cash. Once the wire goes through, the next bank has the cash and the last bank doesn't. That solves the clearing problem (for currencies). Yes, the process is sticky as every bank likes to hold the money as long as possible, but ownership is clear and fast.
The clearing problem for OP is with stocks and deal with purchasing and selling from different owners using a regulatory intermediary (DTCC). Getting all those parts coordinated is more challenging.
Everything is inverted from the bank perspective. When they receive "cash" they actually receive an obligation to pay one of their client against some other debt, which might not be an enviable position.
There is no such thing as digital cash actually. You have cash, the real and physical and all the rest is balance sheet expansion, i.e. debt.
If you are interested in banking I would encourage you to watch this course from the Columbia university: https://www.coursera.org/learn/money-banking which is the reference and is fascinating.
The clearing problem is really at its core about avoiding to move cash and how to transfer debt between two entities that don't know (and trust) each other, as far fetched as it sounds.
When you transfer $1 to a friend of yours that is at another bank, your bank owes you one less dollar and your friend's bank owe him one more. But aginst what? The promise by your bank to pay it with a physical dollar (or some other better debt) in the future. But if you are with a small bank, your friend's bank might not trust it. So the they use a bigger bank that both trust that act as an intermediary and that lends for a very small rate as it is a 100% collateralized debt. This is the definition of clearing.