Cropping images sometimes(?) doesn't work

I have an overview of subpages where I want to crop the preview image so they all have the same size. I do this by:

<picture>
  <img srcset="<?php echo $blogpost->blogimage()->toFile()->thumb(['crop' => true, 'width' => 600, 'height' => 380, 'format' => 'webp', 'quality' => 80])->url() ?>" alt="">
</picture>

Most of the times this works in the overview. However some images (mainly square ones) keep their ratio and are not cropping correctly. The names of the files do change to: image-600x380-crop-1-q80.webp so it seems te be working also because most other images crop correctly. I’m using Imagick on my server (php 8.0) and the newest version of Kirby. What could be the problem here?

Just found out the images the client uploaded are 12611px in width which might have complicated the proces (although image size isn’t that big)… Is there a maximum amount of px width that can be handled?

Have you checked if there are any errors in your server log or php error logs? Might be a memory issue with large images.