Corey Haim/Andrew Koenig Connection

3/11/2010 11:00 AM PST

Corey Haim/Andrew Koenig Connection

In an ironic twist of fate, Corey Haim was fired from a movie in late 2008 because of an alleged drug issue -- a movie that also starred recently deceased actor Andrew Koenig.

Haim was cast as one of the leads in a movie called "DaZe." Executive producer Miller Uwanawich tells TMZ, "Corey's drug problem became too much of a problem" and he was fired as a result.

According to Miller, Corey would show up for table reads and be "all over the place, definitely showing signs of being on drugs."

Miller says he went to Corey's home a few times to try and help him with the apparent drug problem, but was unsuccessful. A.J. Llamas was recast in Corey's role.

It's also the last movie in which Andrew Koenig -- the "Growing Pains" star who committed suicide last month -- appeared.