Fix #5289 (abstract factories return type)

Fixes #5289

Just let me know if you consider allowing services to return `bool(false)` as a BC break.

In any case, imho it should be allowed.