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
.issueDate(System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(randomLongBetween(1, 5000)))
            .maxNodes(type == License.LicenseType.ENTERPRISE ? -1 : randomIntBetween(1, 500))
            .maxResourceUnits(type == License.LicenseType.ENTERPRISE ? randomIntBetween(10, 500) : -1)
            .signature(null)
            .build();
    }
    private void assertExpiryWarning(long adjustment, String msg) {
        long now = System.currentTimeMillis();
        long expiration = now + adjustment;
        String warning = LicenseService.getExpiryWarning(expiration, now);
        if (msg == null) {
            assertThat(warning, is(nullValue()));
        } else {
            assertThat(warning, Matchers.containsString(msg));
        }
    }
    public void testNoExpiryWarning() {
        assertExpiryWarning(LICENSE_EXPIRATION_WARNING_PERIOD.getMillis(), null);
    }
    public void testExpiryWarningSoon() {
        assertExpiryWarning(LICENSE_EXPIRATION_WARNING_PERIOD.getMillis() - 1, "Your license will expire in [6] days");
    }
    public void testExpiryWarningToday() {
        assertExpiryWarning(1, "Your license expires today");
    }
    public void testExpiryWarningExpired() {
        assertExpiryWarning(0, "Your license expired on");
    }
}