Existing 50 amp breaker to 40 amp
Breakers often are tasked with two missions; protecting the conductors is always #1, and sometimes they are there to protect the equipment itself. Going from a 50A breaker to a 40A breaker is no problem from the standpoint of the protecting the conductors; you can always go down in breaker size, just never up.

So that leaves the protection for the cooktop itself. In the installation instructions (assuming you have them) or possibly on a nameplate on the unit, there should be something telling you Minimum Circuit Ampacity (abbreviated as MCA) which is addressing the MINIMUM wire size as discussed above, and there might be another listing of Maximum Over Current Protection (abbreviated MOCP) that is dealing with the protective device (fuse or breaker) that might be required in it's listing. So we cannot answer this for you other than to say "RTFM" (Read The Factory Manual).