```python
def extract_min_max(test_tup, K):
    """
    Extracts the K smallest and K largest elements from a tuple.

    Args:
        test_tup: The input tuple of elements.
        K: The number of minimum and maximum elements to extract.

    Returns:
        A tuple containing the K smallest and K largest elements.
    """
    if not isinstance(test_tup, tuple):
        raise TypeError("Input must be a tuple.")
    if not isinstance(K, int) or K < 0:
        raise ValueError("K must be a non-negative integer.")

    # Sort the tuple to easily find the smallest and largest elements.
    # The sorted() function returns a new list, leaving the original tuple unchanged.
    sorted_elements = sorted(test_tup)

    # Use slicing to get the first K (smallest) elements
    # and the last K (largest) elements.
    min_k_elements = sorted_elements[:K]
    max_k_elements = sorted_elements[-K:]

    # Combine the two lists and convert the result to a tuple.
    result = tuple(min_k_elements + max_k_elements)

    return result
```