Neither of them makes any sense. Most people would say that rain constitutes bad weather. The weather doesn't get worse "when" it's raining.
You can say something like "My mood always seems to get worse when it rains", the suggestion being that the rain is the cause of the bad mood. You can't say that the bad weather is the cause of the bad weather!
Can you explain what your sentences were supposed to mean?
Student or Learner