Welcome to our forum.
If you have a relatively short or moderate run, you are probably ok. 6 gauge wire is rated for up to 60 amps.
I am curious, what is considered a short or moderate run in terms of length?
To my knowledge a breaker is either off or on; no inbetween. Can I try running the tub with the 40A, and see if it trips or should I go with a bigger breaker from the start? How would the tub know what breaker it is hooked up to, besides the actual breaker tripping?-Greg
Do you know what size wire was installed? You can use 10 gauge for up to 30 amps, but 40 amps needs 8 gauge. That's for copper wire.