XCOMMONS-388: In some conditions upgrading the dependency of an invalid extension fail
(cherry picked from commit 610c432b343195af0e05c59e73773a126b201c96)