Indeed the 5th is only a part of a larger set of rights that together are supposed to ensure that the criminal justice system functions properly.
However even when torture as such is banned, contempt of court charges themselves become a form of torture when you're forced to choose between incriminating yourself, contempt of court or perjury.
That's the important distinction between the right to be silent about yourself and the right to be silent about someone else, in your own case you're forced to harm yourself in some manner regardless of which option you choose, which is considered inhumane and unjust, while in the case of a third party you still have an option that leaves you unharmed.
However I'll note that being forced to witness is a fairly rare law which doesn't exist in many other countries such as my own.