Attach (recommended) or Link to PDF file here: [test.pdf](https://github.com/mozilla/pdf.js/files/13053891/test.pdf)

Configuration:
- Web browser and its version: Firefox 118.0.2
- Operating system and its version: Windows 10 Pro 10.0.19045
- PDF.js version: 3.10.86
- Is a browser extension: No

Steps to reproduce the problem:
1. Open the PDF in Firefox.

What is the expected behavior? (add screenshot)
When I open the PDF in Google Chrome or Adobe Acrobat, it looks like this:
![after](https://github.com/mozilla/pdf.js/assets/138867750/6a76ca25-f82a-4041-9d03-2edb36cecfa6)

What went wrong? (add screenshot)
Instead, it looks like this:
![before](https://github.com/mozilla/pdf.js/assets/138867750/4b7789df-56e2-49f4-b0b9-82c22ca6bcaa)

scaleY = 1;
    if (drawnWidth > MAX_GROUP_SIZE) {
      scaleX = drawnWidth / MAX_GROUP_SIZE;
      drawnWidth = MAX_GROUP_SIZE;
    }
    if (drawnHeight > MAX_GROUP_SIZE) {
      scaleY = drawnHeight / MAX_GROUP_SIZE;
      drawnHeight = MAX_GROUP_SIZE;
    }
    this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);
    let cacheId = "groupAt" + this.groupLevel;
    if (group.smask) {
      
      cacheId += "_smask_" + (this.smaskCounter++ % 2);
    }
    const scratchCanvas = this.cachedCanvases.getCanvas(
      cacheId,
      drawnWidth,
      drawnHeight
    );
    const groupCtx = scratchCanvas.context;
    
    
    groupCtx.scale(1 / scaleX, 1 / scaleY);
    groupCtx.translate(-offsetX, -offsetY);
    groupCtx.transform(...currentTransform);
    if (group.smask) {
      
      this.smaskStack.push({
        canvas: scratchCanvas.canvas,