Just before advance showings of certain films, the stars and/or director will appear onscreen to share their passion for the project and to express their hopes we’ll enjoy the movie.

Such was the case with the screening for “Instant Family,” starring Mark Wahlberg and Rose Byrne as a childless couple who foster three siblings. In a straight-to-camera message, director and co-writer Sean Anders explained the story was inspired by his own experiences when he and his wife Beth adopted three siblings some seven years ago.

It was the hardest thing they’ve ever done, said Anders — but also the most wonderful thing ever to happen to them.

No doubt. Huge respect to Anders and his wife for taking on such an enormous responsibility and providing a home for three children.

Of course I was rooting for “Instant Family” to deliver as a heartwarming comedy with elements of poignant drama. Alas, despite winning performances from the adults and the young ones — and yes, some lump-in-the-throat moments — “Instant Family” is a disappointing and uneven mix of broad comedy and sometimes heavy-handed melodrama.

Further lessening the emotional impact: momentum-stopping scenes that feel like lectures about the foster care system; a strange cameo by a celebrated actress that takes us right out of the story, and a raunchy subplot better suited to previous Anders screenplays for R-rated films such as “We’re the Millers” and “Horrible Bosses 2.”

MORE FROM RICHARD ROEPER

• ‘Widows’: Crime, politics and family drama coalesce in a dazzling masterpiece
• ‘Fantastic Beasts: The Crimes of Grindelwald’: An overloaded chamber of subplots

Mark Wahlberg’s Pete and Rose Byrne’s Ellie are a happily married couple who have reconciled themselves to never having children — until Rose clicks on a foster care website filled with pictures of adorable kids hoping one day to be adopted, and Pete sneaks a look at Rose’s laptop after she’s gone to bed, and they decide it couldn’t hurt to attend just one meeting to learn about the process of fostering kids.

Octavia Spencer and Tig Notaro play the good-cop-bad-cop social workers presiding over the introductory session, where they tell the enthusiastic and naïve prospective foster parents no matter how difficult they think it might be, it’s going to be WAY tougher than that. (In addition to Pete and Ellie, the attendees include a gay couple; a religious couple who say they’re following God’s plan, and a Caucasian woman with a specific and unsettling mission: to take in a physically imposing, African-American, teenage male with untapped athletic potential. This prompts Ellie to point out: “That’s the plot of ‘The Blind Side.’ ”)

Without thinking it through, Pete and Ellie opt to host THREE siblings who have bounced around foster care: the surly Lizzy (Isabela Moner), a cynical, bedroom-door-slamming teenager; the sensitive and sweet Juan (Gustavo Quiroz), who curls up in a ball and cries, “I’m sorry, I’m SO sorry” whenever he makes the slightest mistake, leading us to believe he’s been abused, and the adorable but clearly troubled Lita (Julianna Gamiz), who is prone to intense fits in which she hurls things around and screams with rage.

And let’s not forget, not only are Pete and Ellie learning how to be guardians on the fly, they’re not exactly versed in Hispanic culture.

Still, against all odds, as the weeks and months pass by, there’s a chance they can become a permanent family — but of course, that’s when the REAL setbacks and challenges surface.

In the aforementioned story thread that pushes the boundaries of the film’s PG-13 rating, Ellie catches Lizzy as she’s about to send naked selfies to a guy. This leads to a bizarre series of events featuring graphic language about male genitalia; a very public humiliation of a character who doesn’t deserve it, and Pete and Ellie behaving like reckless idiots.

Meanwhile, Margo Martindale (as Pete’s mom) and Julie Hagerty (as Ellie’s mother) play potential-grandma characters straight out of a second-tier sitcom — making the tonal change all that more abrupt when the focus shifts to a courtroom drama, with the children’s birth mother (Eve Harlow), a recovering drug addict recently released from prison, petitioning to regain full custody of the kids.

And then there’s the late-in-the-story, utterly unnecessary and truly baffling appearance by the wonderful Joan Cusack as an apparently unhinged woman who lives around the block from Pete and Ellie and becomes a weirdly distracting observer of some life-changing moments involving a number of people she has just met.

“Instant Family” has heart and good intentions. It’s a shame the journey is such a bumpy ride as it takes us all over the map.

‘Instant Family’

Paramount Pictures presents a film directed by Sean Anders and written by Anders and John Morris. Rated PG-13 (for thematic elements, sexual material, language and some drug references). Running time: 118 minutes. Opens Friday at local theaters.