A jpeg can certainly have a color profile, it does not need to be RGB or Grayscale, it can be say CMYK from some other application.
In Gimp setting the mode, Image -> Mode -> Grayscale and exporting gives options to save the color profile. Edit: Maybe untick that option for your file export.
You can of course Desaturate a RGB image to give gray and export as an RGB image.
It might be an MacOS thing, I do not know. If you can get ImageMagick https://imagemagick.org/script/download.php installed the command line magick identify -verbose filename.jpg can give lots of info and clues.
EDIT: As an example. With Gimp jpeg export and "Save color profile"
ImageMagick gives this
Compression: JPEG
Quality: 90
Orientation: Undefined
Profiles:
Profile-icc: 544 bytes
Properties:
date:create: 2024-04-12T18:39:48+00:00
date:modify: 2024-04-12T18:39:48+00:00
date:timestamp: 2024-04-12T18:42:26+00:00
icc:copyright: Public Domain
icc:description: GIMP built-in D65 Grayscale with sRGB TRC
icc:manufacturer: GIMP
icc:model: D65 Grayscale with sRGB TRC
jpeg:colorspace: 1
jpeg: sampling-factor: 1x1
In Gimp setting the mode, Image -> Mode -> Grayscale and exporting gives options to save the color profile. Edit: Maybe untick that option for your file export.
You can of course Desaturate a RGB image to give gray and export as an RGB image.
It might be an MacOS thing, I do not know. If you can get ImageMagick https://imagemagick.org/script/download.php installed the command line magick identify -verbose filename.jpg can give lots of info and clues.
EDIT: As an example. With Gimp jpeg export and "Save color profile"
ImageMagick gives this
Compression: JPEG
Quality: 90
Orientation: Undefined
Profiles:
Profile-icc: 544 bytes
Properties:
date:create: 2024-04-12T18:39:48+00:00
date:modify: 2024-04-12T18:39:48+00:00
date:timestamp: 2024-04-12T18:42:26+00:00
icc:copyright: Public Domain
icc:description: GIMP built-in D65 Grayscale with sRGB TRC
icc:manufacturer: GIMP
icc:model: D65 Grayscale with sRGB TRC
jpeg:colorspace: 1
jpeg: sampling-factor: 1x1