People waive rights all the time. Anyone who testified in a criminal case waives a right. Anyone who waives Miranda waives a right.
There are rights, and there are protections.
You have a protection against self-incrimination, but you can choose to testify. You cannot have a judge compel you to testify against your protections.
The 8th amendment is a protection against cruel and unusual punishment imposed by the government. Being forced to take a permanent experimental drug or face a harsher sentence is cruel and unusual. A judge cannot compel you to accept a harsher punishment because the alternative punishment is an unconstitutional violation of your protections.
-PJ