Lohan was ordered in March to serve 90 days at a lockdown rehab center after pleading no contest to reckless driving and lying to police after a June 2012 crash in Santa Monica.
However, a California Department of Alcohol and Drug Programs official said the facility is not properly licensed to offer residential recovery treatment programs.
Prosecutors complained about Lohan going to Morningside and were given until next Friday to investigate the center.
The judge agreed that Lohan should remain at Morningside, although the actress' whereabouts were unknown. A celebrity website reported Lohan was shopping at an electronics store while her attorney was in court, and that she never entered Morningside.
Santa Monica Chief Deputy City Attorney Terry White said he was "completely blindsided" by Lohan's placement at Morningside because Heller had previously agreed to send the actress to a different facility that had been vetted.
Lohan has also been found in violation of her probation in a 2011 necklace theft and sentenced to 180 days behind bars, but her jail term can be avoided if she complies with the full terms of her sentence, which include community labor and 18 months of psychological therapy.
The Associated Press contributed to this report.