The console toolchains are proprietary and locked behind NDAs. An engine cannot be both open source and support consoles. What it can (and Godot does) is have a closed-source version of the engine (or just plugins) that you are only permitted to license once Sony/Nintendo/MS has approved you. That version or those plugins can then contain the code required for the consoles.