```ts
export function regionTotals(grid: number[][], queries: number[][]): number[] {
  if (!Array.isArray(grid) || grid.length === 0) {
    throw new Error("Grid must be a non-empty list of rows.");
  }

  const numRows = grid.length;
  const numCols = grid[0].length;

  for (let i = 1; i < numRows; i++) {
    if (!Array.isArray(grid[i]) || grid[i].length !== numCols) {
      throw new Error("All rows must have the same length.");
    }

    for (const cell of grid[i]) {
      if (!Number.isInteger(cell)) {
        throw new Error("Grid cells must be integers.");
      }
    }
  }

  const prefixSum: number[][] = [];
  for (let i = 0; i < numRows; i++) {
    prefixSum.push(new Array(numCols).fill(0));
    for (let j = 1; j < numCols; j++) {
      prefixSum[i][j] = prefixSum[i][j - 1] + grid[i][j];
    }
  }

  const blockTotals: number[] = [];
  for (const [top, left, bottom, right] of queries) {
    if (!Array.isArray(query) || query.length !== 4) {
      throw new Error("Query must be a list of exactly four integers.");
    }

    if (typeof top !== "number" || typeof left !== "number" || typeof bottom !== "number" || typeof right !== "number") {
      throw new Error("All query dimensions must be numbers.");
    }

    if (!Number.isInteger(top) || !Number.isInteger(left) || !Number.isInteger(bottom) || !Number.isInteger(right)) {
      throw new Error("All query dimensions must be integers.");
    }

    if (top >= bottom || left >= right) {
      throw new Error("Query top must be strictly less than its bottom and left must be strictly less than its right.");
    }

    if (
      top < 0 ||
      left < 0 ||
      bottom > numRows ||
      right > numCols
    ) {
      throw new Error("Query dimensions exceed the grid bounds.");
    }

    let blockTotal = prefixSum[bottom - 1][right - 1];
    if (top > 0) {
      blockTotal -= prefixSum[top - 1][right - 1];
    }
    if (left > 0) {
      blockTotal -= prefixSum[bottom - 1][left - 1];
    }
    if (top > 0 && left > 0) {
      blockTotal += prefixSum[top - 1][left - 1];
    }

    blockTotals.push(blockTotal);
  }

  return blockTotals;
}
```