Issue with the new heating cartridge of my 3D printer
If it is 40&nbsp;W then it shouldn't matter what length it is. Note that the heater cartridge just contains a Nickel-Chrome wire-resistor (see image below for the construction), this resistor gives its heat to the metallic shell, the length of that shell shouldn't matter, it usually contains heat free/colder zones at the tip and root. Even if it is a 30&nbsp;W heater cartridge it should be able to get to temperature, it would just take longer.

If it is a 24&nbsp;V, 40&nbsp;W cartridge, operating at 12&nbsp;V, then the effective power would be $40[V] \times \frac{12[V]^2}{24[V]^2}=10 [W]$. This might be too low to reach the temperature. It is best to check the resistance of the heater element with a multitester; it should be about 4 &ohm; for a 12&nbsp;V heater cartridge and about 14 &ohm; for a 24&nbsp;V heater cartridge.