Rounded to the closest whole decade, -1; the first movie to use actual, not CGI/model/etc., F-35s on film was Man of Steel (2013).
Real F-35Bs don't have an internal gun, and if they did, the guns wouldn't fire from the intakes, and if the aircraft took a large chunk of concrete directly into the LiftFan it wouldn't shudder and slowly fall out of the sky, it would be a catastrophic and near instantaneous loss of aircraft and likely aircrew life.
Models (both miniature and full size) were used.
I think it's a bad job of converting from a AV-8, which does have internal guns, located under each intake.
https://www.latimes.com/archives/la-xpm-2011-aug-21-la-ca-mi...
https://nationalinterest.org/blog/buzz/why-f-35-stealth-figh...