Heat the Instant Pot on the sauté setting and add the oil. When hot, add the onion and carrot and cook, stirring occasionally, until softened, about 5 minutes.
Add the chilies, garlic, and ginger and cook, stirring, for about 30 seconds. Add the curry powder, cumin, paprika, cinnamon, turmeric, salt, pepper, and cayenne, if using. Cook, stirring, for about 1 minute more. Stir in the apples and tomatoes and cook, stirring, for another 2 or 3 minutes. Stir in the lentils, rice, and broth and bring to a boil. Turn the pot off.
Cover the pot and turn the valve to the sealing position. Pressure cook on high for 10 minutes. When the cooking time is up, quick release the pressure.
Using an immersion blender (or in batches in a countertop blender), puree the soup, leaving some chunks for texture.
Stir in the coconut milk and reheat if needed.
Serve hot, topped chopped cilantro.
