reduces some drag and adds lift
Coefficient of lift increases with camber, so not sure about this. Agree drag increases.
With more flaps the center of lift moves towards the wing roots, and there is some loss of lateral stability. With increased drag and more power, the reduced lateral stability might result in an earlier stall, but I don’t convince myself of this reason for a slightly higher stall speed at F40. Test pilots would plot dozens/hundreds of tests before they convinced themselves that Flaps 30 has a lower stall speed than Flaps 40.
Another theory might be the semi fowler design stops increasing wing area at Flaps 30, and the increase in drag of flaps 40 dominates the camber effect. But F40 is not F90 so wing area is still increasing albeit at a smaller rate.
It is always worth recalling that the Wright brothers got there by experimentation and not through fluid dynamic calculus - in fact the Navier Stokes partial differential equations for fluid dynamics remain incomplete for well over a century, with a large money prize still outstanding for completing them.
The French and British bashed away at calculus while the Wright Brothers tinkered in their wind tunnel.

