As the groovy console is relying on the OSGi installer to deploy the bundle the according service is only available after a certain delay. That makes it impossible to deploy
- vault-upgrade-hook
- groovy-console
- package leveraging groovy upgrade hook
in the same package.
Maybe some mechanism like https://sling.apache.org/documentation/bundles/installer-provider-installhook.html could be used to be able to deploy those three things in one go.