See this thread, where the OP had the same error message on macOS Ventura:
It’s a generic error message so it may be a different error; if the fixes there don’t work, please share the full installation log as that user did for us to be able to help further. Thanks.