input: Write a function to calculate word frequencies in a text document and identify misspelled words.
  assert calculate_word_frequencies_and_misspellings('input.txt') == ({'the': 3, 'and': 2, 'cat': 1, 'dog': 1}, set())
  assert calculate_word_frequencies_and_misspellings('input_with_errors.txt') == ({'the': 3, 'and': 2, 'cat': 1, 'dog': 1}, {'dgo', 'tca'})
  assert calculate_word_frequencies_and_misspellings('empty.txt') == ({}, set())
output: def calculate_word_frequencies_and_misspellings(file_path):
      import re
      from collections import Counter
      from spellchecker import SpellChecker
  
      spell = SpellChecker()
      word_frequencies = Counter()
      misspelled_words = set()
      
      with open(file_path, 'r') as file:
          text = file.read().lower()
      
      words = re.findall(r'\b\w+\b', text)
      word_frequencies.update(words)
      
      misspelled_words.update(spell.unknown(words))
      
      return dict(word_frequencies), misspelled_words