Runtime lag spikes in Godot web games often happen when instancing things that haven't been rendered before.
This not only includes materials but also how they look when light shines on them among other runtime constellations.
A common workaround is to show everything to the camera at the start of the hame for at least a few frames.