At the moment, Ballerina service generation from OpenAPI specification does not support complex paths as mentioned in the diagnostics. This is a limitation in the ballerina resource syntax. Please refer to this issue for more information: https://github.com/ballerina-platform/ballerina-spec/issues/1238#issuecomment-1767582117
In Ballerina client generation, the tool fallback to use remote methods for client rather the resource methods(default option). But in the case of service stub generation, it is not possible. That is why you are getting this error.