Are both of these sentences grammatical?
It was starting raining.
He was contemplating creating a problem.
Both are grammaticaly correct, as evidenced by the fact that you can say “it starts raining” and “he contemplates creating a problem”. The phrases you wrote are just the corresponding progressive tense.
Of course, as a matter of style, it is awkward to have those two -ing forms one right after the other. So, people would usually write it in other ways to avoid this, including “it was starting to rain”.