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
randomIntBetween(1, LicenseService.ALLOWABLE_UPLOAD_TYPES.size() - 2),
            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();
        final License.LicenseType notAllowed = randomValueOtherThanMany(
            test -> allowed.contains(test),
            () -> randomFrom(LicenseService.ALLOWABLE_UPLOAD_TYPES)
        );
        assertRegisterDisallowedLicenseType(settings, notAllowed);
    }
    /**
     * Tests that the license overrides from {@link LicenseOverrides} are applied when an override is present for a license's ID.
     */
    public void testLicenseExpiryDateOverride() throws IOException {
        UUID licenseId = UUID.fromString("12345678-abcd-0000-0000-000000000000"); 
        License.LicenseType type = randomFrom(License.LicenseType.values());
        License testLicense = buildLicense(licenseId, type, TimeValue.timeValueDays(randomIntBetween(1, 100)).millis());
        assertThat(LicenseService.getExpiryDate(testLicense), equalTo(new Date(42000L).getTime()));
    }
    /**
     * Tests that a license with an overridden expiry date that's in the past is expired.
     */
    public void testLicenseWithOverridenExpiryInPastIsExpired() throws IOException {
        UUID licenseId = UUID.fromString("12345678-abcd-0000-0000-000000000000"); 
        License.LicenseType type = randomFrom(LicenseService.ALLOWABLE_UPLOAD_TYPES);
        License testLicense = sign(buildLicense(licenseId, type, TimeValue.timeValueDays(randomIntBetween(1, 100)).millis()));
        tryRegisterLicense(Settings.EMPTY, testLicense, future -> {
            PutLicenseResponse response = future.actionGet();
            assertThat(response.status(), equalTo(LicensesStatus.EXPIRED));