Since you’ve already replaced the drain pump and confirmed that the filter, waste hose and tub-to-pump hoses are clear, I’d check one thing before replacing anything else: does the washer actually empty the water when 5C appears?
If water remains in the drum, I’d look at the pump wiring and whether the pump is actually being driven during the drain stage. If the tub drains normally but the machine still reports 5C, the water-level sensing side becomes much more interesting, including its hose and electrical connection.
Samsung also uses 5E, 5C, SC and nd for the same general no-drain fault family on different models. I put the diagnostic order together here: https://www.errasift.com/samsung-washing...