For `POST _license/start_basic` the API, the system decides whether a new basic license should be generated using the following logic:

https://github.com/elastic/elasticsearch/blob/3c15e4ebb1ae045d5cc690a0fd1e2f3c73173d39/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartBasicClusterTask.java#L101-L106

However, when building the response, the logic only takes account into old license type without checking maxNodes and expiryDate:

https://github.com/elastic/elasticsearch/blob/3c15e4ebb1ae045d5cc690a0fd1e2f3c73173d39/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartBasicClusterTask.java#L64-L65

This means it is possible that client gets an error response of 
```json
{
  "acknowledged": true,
  "basic_was_started": false,
  "error_message": "Operation failed: Current license is basic."
}
```
while the license is actually generated successfully at the backend. 

See also: https://github.com/elastic/elasticsearch/pull/85993#discussion_r859356499
x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseServiceTests.java
}
    }
    /**
     * Tests loading a license when {@link LicenseService#ALLOWED_LICENSE_TYPES_SETTING} is on its default value (all license types)
     */
    public void testRegisterLicenseWithoutTypeRestrictions() throws Exception {
        assertRegisterValidLicense(
            Settings.EMPTY,
            randomValueOtherThan(License.LicenseType.BASIC, () -> randomFrom(License.LicenseType.values()))
        );
    }
    /**
     * Tests loading a license when {@link LicenseService#ALLOWED_LICENSE_TYPES_SETTING} is set,
     * and the uploaded license type matches
     */
    public void testSuccessfullyRegisterLicenseMatchingTypeRestrictions() throws Exception {
        final List<License.LicenseType> allowed = randomSubsetOf(
            randomIntBetween(1, LicenseService.ALLOWABLE_UPLOAD_TYPES.size() - 1),
            LicenseService.ALLOWABLE_UPLOAD_TYPES
        );
        final List<String> allowedNames = allowed.stream().map(License.LicenseType::getTypeName).toList();
        final Settings settings = Settings.builder().putList("xpack.license.upload.types", allowedNames).build();
        assertRegisterValidLicense(settings, randomFrom(allowed));
    }
    /**
     * Tests loading a license when {@link LicenseService#ALLOWED_LICENSE_TYPES_SETTING} is set,
     * and the uploaded license type does not match
     */
    public void testFailToRegisterLicenseNotMatchingTypeRestrictions() throws Exception {
        final List<License.LicenseType> allowed = randomSubsetOf(