I found an existing issue that makes it look like it's a Docker issue and the workaround is to downgrade the version of Docker: https://github.com/aws/aws-sam-cli/issues/7598
Although it's weird that your issue was fixed just by changing SAM CLI and not Docker