If Apple silicon version of Docker Desktop is installed then some containers will be for arm64 architecture instead of amd64. So when installing WKHTMLtoX a proper package has to be installed.