Gifted Spanish filmmaker Pedro Almodóvar, comfortable in comedy, drama and melodrama, tries a lovelorn Romeo and Juliet story in “Julieta.” His latest addition to a long run of fine films and flawed ones, it reminds us that he produces misfires as well as masterpieces.

First and foremost a fine director of actresses, Almodóvar here guides two excellent female performers playing two sides of a single character. Julieta (Emma Suárez) is a Madrid matron of a certain age when we meet her, living independently in a striking minimalist apartment and spending as much time as she likes with the older man in her life.

She is chic and confident until fate puts her in the path of a young woman she knew long earlier. The woman shares what ought to be good news: She has encountered Julieta’s daughter, who has moved back to Madrid with her three children. Julieta, shaken by the unexpected news, revisits her own youth in flashback-framed memories to explore how she and her daughter became deeply estranged.

Pulling back 30 years earlier, we encounter Julieta (now played by Adriana Ugarte) not very long after college. She’s a stylish mid-’80s punkette on a train trip to a new job as a teacher. She is cornered by an elderly fellow who seems overly hopeful to draw her into deep conversation until she flees to a different car. Once there, she encounters a handsome young fisherman from a village on the coast, and they use a private room to get to know each other very well.

But then her fortunes turn. The man she earlier spurned commits suicide, triggering feelings of remorse and guilt that trouble her repeatedly throughout the story.

Regularly handing off the character of Julieta to each other, the stars work in close harmony, keeping our attention despite a plot overstuffed with unresolved issues. Scripted by Almodóvar based on three subtle short stories by Alice Munro, the film tracks Julieta across the decades into archetypal issues of marriage, motherhood, infidelity, loss, faith, mortality and making amends.

Through it all, Almodóvar’s signature palette of strong primary colors offers symbolic links among the tales but doesn’t connect them explicitly or effectively. A multilayered meditation on the feminine life force, family and the Spanish sense of life, it plays like an earthly ghost story as Julieta’s dear ones haunt her.

While visually attractive and emotionally rich, the movie is also a rambling walk to an open-ended finale that fizzles out. Individual developments are intriguing, but poorly integrated. While I have avidly enjoyed many of the director’s earlier films, this felt gloomy, too inward-looking.

“Julieta” doesn’t deduct points from Almodóvar’s impressive canon of films, but it doesn’t add any points, either. He’s 67, and I hope he returns to form and works for many years to come. This film would be a disappointing denouement.