```ts
export function formatBits(value: number, width: number): string {
  if (typeof value !== 'number' || !Number.isInteger(value) || value < 0) {
    throw new Error('value must be a non-negative integer');
  }
  
  if (width <= 0 || width % 4 !== 0 || width > 32) {
    throw new Error('width must be a positive multiple of four and no more than 32');
  }

  const binaryString = value.toString(2);
  const paddingLength = Math.max(0, width - binaryString.length);

  let formattedBits = '0'.repeat(paddingLength) + binaryString;

  // Split into groups of four bits
  const nibbles = formattedBits.match(/.{1,4}/g)!;
  return nibbles.join(' ');
}

// Example usage:
console.log(formatBits(300, 12)); // Output: "0001 0010 1100"
```