After the success of their lightweight unlikely-buddy dramedy “The Intouchables”—about a staid wheelchair-bound man liberated by the devil-may-care French-Senegalese caregiver he hires—Omar Sy reunites with writer-directors Eric Toledano and Olivier Nakache for something ostensibly more serious (and certainly topical), a story about a gentle “illegal immigrant” who’s been in Europe for a decade but is now threatened with deportation. “Samba”—titled after Sy’s Senegalese character—is essentially a romcom in which the plight of undocumented workers in France serves as a major plot device, and it turns out to be as weird and tonally variable as that combination sounds.

Sy, an actor whose natural charisma enlivened even an overproduced stiff like Michel Gondry’s “Mood Indigo” (but still couldn’t stand out against the dinosaurs of “Jurassic World”), certainly invests his character with dignity and strength. Samba is working in the kitchen of a posh Paris restaurant and living simply with his uncle, a legal resident in the French capital. But when he’s taken into custody and sent to a detention camp, he’s offered help from an immigrants’ assistance group in the person of Manu (Izia Igelin), a seasoned veteran who’s accompanied to his initial session by nervous Alice (Charlotte Gainsbourg, playing nicely against type), a mousy newcomer to the group. Alice, whose neediness could set off a fire alarm, immediately forms an emotional bond with Samba, despite Manu’s warning to avoid such attachments with their clients.

Samba is eventually released with orders to leave France that even the camp guards know he won’t observe. (His departure from the center is, in fact, treated as a comic set-piece.) And he leaves with a mission: to find the fiancé of his cellmate Jonas (Issaka Sawadogo). He does so, but spends the night with her himself—something over which he feels guilt and shame. More importantly, he returns to the assistance center, where he connects again with Alice, with whom he develops a mutual (if halting) attachment. She eventually tells him about herself: she was a driven executive for years until she suffered a breakdown from which she’s now recovering, her time with the assistance bureau being part of the process of reconnecting to the world before going back to work. And she grows more and more protective of him.

Of course, no romcom is complete without an array of colorful supporting characters, and “Samba” supplies not only the vivacious Manu, who chides Alice jokingly about her relationship with Samba, and Uncle Lamouna (Youngar Fall), who remonstrates with his nephew about keeping a low profile, but most importantly Wilson (Tahar Rahim), a reckless Brazilian Lothario whom Samba meets among the groups of men seeking to be chosen as day-laborers. The two become fast friends despite—or because of—their differences, and Wilson becomes key to most of the picture’s overtly comic interludes—one set on a window-washing platform, which turns into an impromptu dance that might have come out of “Magic Mike,” is especially broad, but others come fairly close. Wilson is a real audience-pleaser in the sitcom sense, and his presence makes clear that while Toledano and Nakache might be delivering a message, they do so in the most crowd-friendly way possible. Whether or not you agree with that approach, it has to be said, though, that Rahim pulls off the character with elan and often gives the film a jolt of energy when it sometimes appears to be running down. He also features prominently in another of the picture’s comic set-pieces, a party at the immigrant assistance bureau where all the elderly ladies we’ve seen talking to clients about their problems get the chance to show off their ditzy qualities in ways sure to amuse older members of the audience.

Oddly, however, those humorous bits are increasingly juxtaposed, rather uncomfortably, with ever more intensely dramatic ones. A rooftop escape by Samba and Wilson with Harry Langdon overtones is soon followed by a tense reunion between Samba and Jonas that leads to a police chase with tragic twist that brings an ambivalent denouement. But that close, which seems so downbeat, is suddenly turned in the opposite direction, though it still leaves us hanging.

That’s all part of Toledano and Nakache’s effort to decry the harsh approach that France—and other European nations—have taken to immigration policy, but to do so in the most palatable of forms. “Samba” deserves credit for raising important issues at all, but the trite romcom packaging compromises the good intentions.