The sentence is fine vikram.
"which" and other relative pronouns can refer to the noun immediately before or to the phrase immediately before the comma. Both of the following sentences are correct:
The roof of the gingerbread house, which is located at 123 My Street, leaks every time it rains.
The roof of the gingerbread house, which was replaced only 3 years ago, leaks every time it rains.
Whether "which" refers to the noun or to the entire phrase that precedes it is determined by the intended meaning. Think about which story the author is trying to tell.
In your example, it doesn't make as much sense to mean that the movie was offered to Queen Latifah as it does to mean that the role was offered to Queen Latifah. Thus "which" is referring to the role.
What "which" cannot do is refer to a noun or phrase that is on the other side of a verb. For instance, the following is problematic: "This raw deal cost me a fortune, which was supposed to be completed in 6 months but instead took 6 years". In this case, which cannot refer to the deal.
"which" is also a poor way to modify an action. For instance the following sentence is problematic: "All the employees quit on the same day, which led to our bankruptcy." In this case, an -ing ("leading to our bankruptcy") or a noun ("a catastrophe which led to our bankruptcy") are better suited.