```python
def line_tag(body: str) -> str:
    return f"{sum(ord(char) for char in body) % 256:02x}"

def check_line(line: str) -> str:
    if not isinstance(line, str):
        raise ValueError("Line must be a string.")
    
    if len(line) < 3:
        raise ValueError("Line must contain at least three characters.")
    
    parts = line.split('~')
    if len(parts) != 2:
        raise ValueError("Line must contain exactly one '~' character.")
    
    body, tag = parts
    
    if not isinstance(body, str):
        raise ValueError("Body must be a string.")
    
    if body[-1] == '~':
        raise ValueError("Last character of the body cannot be '~'.")
    
    if len(tag) != 2 or not all(char in '0123456789abcdefABCDEF' for char in tag):
        raise ValueError("Tag must be exactly two lowercase hexadecimal digits.")
    
    computed_tag = line_tag(body)
    if computed_tag != tag:
        raise ValueError(f"Line tag does not match body. Expected {tag}, got {computed_tag}.")
    
    return body
```