You asked

Is the nikon z 24mm f 1 8 s good for astrophotography?

Here is what the site says about that.

From Nikon Z 24mm f/1.8 S: Nikon Z 24mm f/1.8 S: A prime lens by Nikon for Full frame cameras, 24mm f/1.8. Specs - Maker: Nikon - Focal length: 24mm (prime) - Maximum aperture: f/1.8 - Made for: Full frame sensors - Mounts: Nikon Z - Stabilised: no - Autofocus: yes What it frames like - On full frame (Nikon Z): as marked, 24mm. - On APS-C (Nikon Z): like 36mm on full frame; f/1.8 gives about the depth of field ...

From Nikon Z 14-24mm f/2.8 S: Nikon Z 14-24mm f/2.8 S: A zoom lens by Nikon for Full frame cameras, 14-24mm f/2.8.

Quoted from this site's pages.

From these pages