Formation and switching of chiral magnetic field textures in three-dimensional gyroid nanostructures