So it seems the issue is with OverlayFS and the underlying kernel version. The kernel prior to 4.9 overlayfs is not supporting POSIX access-control lists (https://lwn.net/Articles/718062/) and that seems the issue. Where our container libraries (and sed particularly) support ACLs starting version 4.5.2 - https://metadata.ftp-master.debian.org/changelogs//main/s/sed/sed_4.7-1_changelog.
I assume the issue can be closed and the fix would be either to upgrade the underlying OS (kernel), change of docker storage driver or downgrading container library (sed binary) versions. Many thanks to Krzysztof Opasiak for pointing out the root cause.