Hathaway, 30, had started shooting for the movie before the couple tied the knot in September, and she had asked her then fiance, Shulman, to stay with her while the shooting was on.
However, she later realised that his presence was not letting her get into the character, reported Sun online.
"About three days into it I realised I was going to have to ask him if he didn't mind me being by myself because he was making me so happy," said Hathaway.
"I said, 'I really need to be a bit more miserable actually', so he went home and I crawled inside the misery of the character just fine without him," she added.
Directed by Tom Hooper, "Les Miserables" also stars Hugh Jackman and Russell Crowe.
It is slated to release on December 25.