Prepare the squash, beans, lime leaves and basil as listed. Prepare the garlic, ginger and lemongrass if using shop bought paste, and stir the coconut milk until combined. Cut the chicken into 3cm pieces on a separate board.
Heat the oil in a wide saucepan over a medium heat. Add the curry paste and, for shop bought paste, the garlic, ginger and lemongrass. Stir for 2 to 3 minutes until fragrant and slightly darker, lowering the heat if the garlic browns quickly. Loosen with a splash from the measured 250ml stock if needed.
Add any stock not used in Step 2 and stir to dissolve the paste. Simmer briskly, uncovered, for about 3 to 4 minutes, stirring regularly, until the stock has reduced by roughly half.
Stir in the coconut milk, lime leaves, 1 tablespoon sugar and 10ml fish sauce. Add the chicken, bring back to a gentle simmer and cook uncovered for 4 minutes.
Add the squash and simmer gently for 8 to 10 minutes, stirring occasionally, until a knife enters with just a little resistance. If the centre is still hard, continue cooking before adding the beans.
Add the beans and simmer for 4 to 5 minutes, or until the squash is tender and the beans are cooked with a little bite. Check a thick chicken piece with a clean food thermometer; the centre should reach 75°C for at least 30 seconds. Continue cooking if necessary, adding a splash of hot water if the sauce becomes too thick.
Taste the cooked sauce and adjust with a little extra fish sauce or sugar as needed, tasting after each addition. Remove the lime leaves, turn off the heat and stir in the Thai basil. Serve with jasmine rice and the optional sliced chilli.