"Both of them" // "Both of whom"
Solution 1:
If a relative is formed with the help of a pronoun, that pronoun must necessarily be a relative pronoun, not a personal pronoun. About relative pronouns, Wikipedia explains:
In the English language, the following are the most common relative pronouns: which, that, whose, whoever, whomever, who and whom.
According to some dependency grammar theories, a relative pronoun does not simply mark the subordinate (relative) clause but also may be considered to play the role of a noun within that clause.
In your sentence, both of whom does 2 jobs:
- it introduces the relative clause both of whom I am immensely grateful for [or to in cases indicated in the comments1], modifying Katheryn and Aiden.
- it functions as a prepositional complement of for/to
Both of them is only able to do job nr. 2, so if you were to use it, the order of words would need to be changed. The phrase does not connect the first clause to the second in a subordinating way, so there is no reason for it to head the independent clause:
Credit must also be given to Katheryn and Aiden, I am immensely grateful for/to both of them.
Them is a personal pronoun which replaces Katheryn and Aiden, but does not modify those nouns in the way whom does.
1 Note that grateful for someone has known an increase in use since around 2000, grateful to someone has always had the upper hand and still does. I agree with the definition given in @Canadian Yankee's comment: grateful for someone means you are thankful that they exist.