Aerial Refueling is inherently dangerous as one would imagine.
It's possible the F-35 canopy or flight control surface collided with the refueling boom
The boom flies dangerously close to the canopy of the acft being refueled.
(observation from experience USAF)
(pics show boom proximity to canopy)