```python
def line_tag(body: str) -> str:
    """Compute the tag of a body as the sum of its character codes modulo 256,
    rendered as exactly two lowercase hexadecimal digits, zero-padded."""
    if not isinstance(body, str):
        raise ValueError("Body must be a string")
    return f"{(sum(ord(c) for c in body) % 256):02x}"


def check_line(line: str) -> str:
    """Verify a tagged line and return its body. Rejects non-string lines,
    lines shorter than three characters, lines without the correct tilde
    character, and lines with a mismatched tag."""
    if not isinstance(line, str):
        raise ValueError("Line must be a string")
    if len(line) < 3:
        raise ValueError("Line must be at least 3 characters long")
    if line[-3] != '~':
        raise ValueError("Third-from-last character must be a tilde")
    tag = line_tag(line[:-3])
    if line[-2:] != tag:
        raise ValueError("Tag does not match the body")
    return line[:-3]
```