Got the issue. You need to return not only the token but the whole string in text/plain to make it work.
functions.http('groupsHttp', (req, res) => {
let validationToken = req.query.validationToken;
return res.set('Content-Type', 'text/plain; charset=utf-8').status(200).send(validationToken);
});