```ts
export function recaseName(label: string, style: string): string {
  if (typeof label !== 'string' || typeof style !== 'string') {
    throw new Error('Both label and style must be strings.');
  }
  if (label.length === 0) {
    throw new Error('Label cannot be empty.');
  }
  if (!/^[a-zA-Z0-9_-]+$/.test(label)) {
    throw new Error('Label contains invalid characters.');
  }
  if (/^[-_]|[-_]$|[--][-_]/.test(label)) {
    throw new Error('Label starts or ends with a separator or has consecutive separators.');
  }
  if (!['snake', 'kebab', 'shout', 'pascal', 'camel'].includes(style)) {
    throw new Error('Invalid style specified.');
  }

  const words = label.match(/(?<=[0-9])(?=[A-Z])|[A-Z](?=[a-z]+)|[a-z]+|[0-9]+|_/g)?.filter(word => word !== '_') || [];
  
  const isAllCaps = (word: string) => /^[A-Z]+$/.test(word);
  const isDigits = (word: string) => /^\d+$/.test(word);

  const transformedWords = words.map((word, index) => {
    if (isAllCaps(word) && word.length > 1 && !isDigits(word)) {
      return word.slice(0, -1);
    }
    return word;
  });

  const finalWords = [];
  for (let i = 0; i < transformedWords.length; i++) {
    let word = transformedWords[i];
    if (i > 0 && isAllCaps(transformedWords[i - 1]) && !isDigits(transformedWords[i - 1])) {
      word = transformedWords[i - 1].slice(-1) + word;
    }
    finalWords.push(word);
  }

  const separator = style === 'snake' ? '_' : style === 'kebab' ? '-' : '_';
  const joinedWords = finalWords.join(separator);

  switch (style) {
    case 'snake':
      return joinedWords.toLowerCase();
    case 'kebab':
      return joinedWords.toLowerCase();
    case 'shout':
      return joinedWords.toUpperCase();
    case 'pascal':
      return finalWords.map((word, index) => 
        isAllCaps(word) && word.length > 1 || isDigits(word) ? word : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
      ).join('');
    case 'camel':
      return finalWords.map((word, index) => 
        index === 0 ? word.toLowerCase() :
        (isAllCaps(word) && word.length > 1 || isDigits(word) ? word : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
      ).join('');
    default:
      throw new Error('Invalid style specified.');
  }
}
```