## ImageMagick version
7.1.1-29

## Operating system

`Linux 5.10.0-0.deb10.16-amd64 #1 SMP Debian 5.10.127-2~bpo10+1 (2022-07-28) x86_64 GNU/Linux`

## Description

Randomly when resizing a file the result became grayscale (black and white only).

## Steps to Reproduce

```bash
#!/bin/bash
for i in {1..1000}
do
  magick convert test.jpg -resize '1920x>' -verbose ./tmp/test.jpg`
done
```

When the resized image is correct it will output:

`test.jpg=>/tmp/test.jpg JPEG 1402x1039 1402x1039+0+0 8-bit sRGB 93218B 0.040u 0:00.037`

![test-12](https://github.com/ImageMagick/ImageMagick/assets/4710495/a5fe7ea7-f5d8-4000-a032-81f8ebc78ea6)


When the resized image is not correct it will output:

`test.jpg=>/tmp/test.jpg JPEG 1402x1039 1402x1039+0+0 8-bit sRGB 81473B 0.040u 0:00.073`

![test-12](https://github.com/ImageMagick/ImageMagick/assets/4710495/4b96f951-c4d0-467f-8e72-35630347ba1e)


## Images

![CleanShot](https://github.com/ImageMagick/ImageMagick/assets/4710495/0ced58fa-fbec-423f-a6de-8d853f4d229b)


Colored image become grayscale randomly on resize
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Colored image become grayscale randomly on resize
Issue date:

--- start body ---
## ImageMagick version
7.1.1-29

## Operating system

`Linux 5.10.0-0.deb10.16-amd64 #1 SMP Debian 5.10.127-2~bpo10+1 (2022-07-28) x86_64 GNU/Linux`

## Description

Randomly when resizing a file the result became grayscale (black and white only).

## Steps to Reproduce

```bash
#!/bin/bash
for i in {1..1000}
do
  magick convert test.jpg -resize '1920x>' -verbose ./tmp/test.jpg`
done
```

When the resized image is correct it will output:

`test.jpg=>/tmp/test.jpg JPEG 1402x1039 1402x1039+0+0 8-bit sRGB 93218B 0.040u 0:00.037`

![test-12](https://github.com/ImageMagick/ImageMagick/assets/4710495/a5fe7ea7-f5d8-4000-a032-81f8ebc78ea6)


When the resized image is not correct it will output:

`test.jpg=>/tmp/test.jpg JPEG 1402x1039 1402x1039+0+0 8-bit sRGB 81473B 0.040u 0:00.073`

![test-12](https://github.com/ImageMagick/ImageMagick/assets/4710495/4b96f951-c4d0-467f-8e72-35630347ba1e)


## Images

![CleanShot](https://github.com/ImageMagick/ImageMagick/assets/4710495/0ced58fa-fbec-423f-a6de-8d853f4d229b)


--- end body ---
