Thankyou for asking this question.
This is indeed an interesting question! To understand this you need to understand the process of a bill becoming a law.
A bill goes through many levels and authorities in order to become a law. There are different processes for different types of bills namely - ordinary bills, financial bills, money bills and amendment bills.
Let's take the example of an ordinary bill. An ordinary bill can be introduced in any house. It can be introduced by any member of any party. The speaker has to approve it first with a standing vote of atleast 50 members. After which three readings take place. First reading - Name and objective of the bill is read in the house by the member who introduces it. Bill then goes to the select committee for further scrutiny. Second reading - general descripttion of the bill and reading the bill clause by clause Third reading - the voting
The bill then goes out to the other house for the same process.
When passed by both the houses the bill goes to the president for his assent. When the president gives his assent, the bill is converted into a law.
This elaborate procedure can take months or even years.
The second thing you need to know is what is contempt of court. It is showing disrespects and disobedience towards the court of law which means one faisl to obey the court order or disrespect the legal authorities.
Therefore if the parliament after such an intensive procedure, makes a law and "the HC/SC strikes down the legislation" it is highly unlikely that the parliament passes the same law again. And if it does, and the intent of the government is to mock the law and the court is convinced of such mockery, then it might be framed as the contempt of court.
Hope you find this helpful! :)