```python
def region_totals(grid: list[list[int]], queries: list[list[int]]) -> list[int]:
    if not grid or not grid[0] or not all(len(row) == len(grid[0]) for row in grid):
        raise ValueError("Invalid grid")

    rows, cols = len(grid), len(grid[0])
    prefix_sum = [[0] * (cols + 1) for _ in range(rows + 1)]

    for i in range(1, rows + 1):
        for j in range(1, cols + 1):
            prefix_sum[i][j] = grid[i - 1][j - 1] + prefix_sum[i - 1][j] + prefix_sum[i][j - 1] - prefix_sum[i - 1][j - 1]

    results = []
    for top, left, bottom, right in queries:
        if not (isinstance(top, int) and isinstance(left, int) and isinstance(bottom, int) and isinstance(right, int)):
            raise ValueError("Invalid query")
        if top < 0 or left < 0 or bottom > rows or right > cols or top >= bottom or left >= right:
            raise ValueError("Invalid query bounds")

        results.append(prefix_sum[bottom][right] - prefix_sum[top][right] - prefix_sum[bottom][left] + prefix_sum[top][left])

    return results
```