I had an issue while importing modules with lambda layer. I was using macos, each time when I wanted a compressed image, I used GUI. It was the culprit in my case. When I changed to CLI, it worked like charm.