I've experienced something like that before with a friend's car. It would eventually stop working when warm, but might be able to drive about a mile at a time until the transmission stopped moving it. Let it cool down and it could maybe go for another mile.
It's the transmission and more likely it's a coincidence. When you say "putting it in gear" is it the 5-speed manual or the 6-speed automatic? I'm assuming this is an automatic and you're really just putting it in drive? A manual wouldn't likely do that. Maybe if a few teeth were broken/chipped they might move a little bit and then clunk.
The "automatic" transmission on the 2014 Festiva is the notorious PowerShift transmission. It's actually a dry dual-clutch transmission. It's supposed to be more efficient than a traditional automatic transmission (with torque converter) as it functions more like two dry-clutch manual transmissions. The notorious part was really harsh shifts that would cause some nasty shudders and premature wear.
The Ford PowerShift transmission in question is found in 2011–2016 Fiesta and 2012–2016 Focus cars. As described by owners of the vehicles, the primary, recurrent issues are a shuddering feeling while accelerating from a stop—like someone who can't feather the clutch properly on a stick shift—followed by a rough 1-2 upshift that again sends a vibration throughout the vehicle. Owners have reported replacing clutches, output shafts, and entire transmissions. They've come back for software updates. More often than not, as described by owners we've spoken to and on forums across the internet, the problems reappear even after service technicians claim the transmission is within normal factory limits.
What's the Problem?
In place of a conventional automatic's torque converter, this dual-clutch six-speed transmission uses two clutch packs to couple the engine to the transmission—one that's engaged when an odd gear is selected, the other for evens. Dual-clutch gearboxes typically deliver improved fuel economy and faster shifts than a traditional automatic. But these transmissions also tend to slip the clutch like a manual when getting off the line and can shift rougher than a torque-converter automatic. Exacerbating these undesirable traits, the Ford uses dry clutches in the interest of efficiency. Wet clutches, which bathe the friction discs in hydraulic fluid, offer smoother engagement. It's no coincidence that the better dual-clutch transmissions—such as those used by Audi, BMW, Porsche, and Volkswagen—use wet clutches. In the case of the Ford transmission, many owners simply weren’t used to dual-clutch transmission feel. But in the U.S. and across the world, this transmission’s history of needing frequent repairs has been well documented.