It was because after deploying the latest version, cloudfront is cleaning all the deployed versions of the old version of the same lambda from all the edge locations. Cleaning up process takes some time than deploying a new version of the lambda and the cloudfront updates the timestamp of the old version when the clean up process get finished. That's why the old version of edge lambda has the latest last_modified timestamp than the new version.