You don’t mention how much swap is actually used, but unless there’s a huge amount, this sort of situation can be explained by a process (or multiple processes) consuming all the available memory, or causing it to be consumed (e.g. by reading many files without indicating that they shouldn’t be cached). This causes as much data as possible to be pushed out of memory, and some of that will end up in swap.
Data in swap is only pulled back into memory if something needs to use it, so it’s common for systems to accumulate data in swap (corresponding to data which was used at some point but isn’t regularly required). Even when data is used, it can also be kept in swap — so that if memory needs to be freed again, it doesn’t need to be copied back to swap (if it hasn’t changed).
The only way to reliably reduce swap usage is for processes with data in swap to exit (or be killed), or for the available swap itself to be reduced (swapoff).
The sort of situation you describe shouldn’t cause insurmountable problems. If the data in swap is actively being used, the system will slow down quite a bit until it’s reloaded into memory, but since you have lots of available memory your system is nowhere near thrashing (where it spends all its time shuffling data to swap and back).
sudo swapoff && sudo swaponwhich will turn off and then reanable swap and that should clear it out. But in principle (at least as far as I know, but take this with a grain of salt, I am not 100% sure) as soon as you need swap, the old stuff should be swapped out.