You should use the correctly rated breaker protection for any device / circuit. A breaker rated too high is dangerous, as it does not provide the protection for which it's intended and could result in a fire. What exactly are you installing? 40A sounds high for a domestic immersion heater element.
Too low a rating will be prone to trip unnecessarily, although it might not as most circuits and individual appliances aren't run at maximum load all the time. However, simple heating elements are either on or off, so current draw will essentially be at either maximum or zero (although the exact current draw is also affected by some other variables, such as the element's own change in temperature).
The opposite is true of wiring, where overspecifying with thicker cable than necessary is perfectly safe, while narrower cable than required can overheat and may cause a fire. Note that the length of cable is also a factor, requiring thicker gauge over a longer run. Also, on immersion heaters, ensure you use heat resistant cable between the local isolator switch and element.