If this is a DACRON mainsail, from your description its sounds like youre not fully raising
your mainsail in the first place - not enough 'luff tension' in the raised sail (or you have a severely 'shrunken' bolt rope along the luff of that sail)
If the aft end of your boom is lower than the horizontal level of/to the gooseneck with your sail 'raised' most probably
youre raising the main to 'just up' and NOT putting in enough (additional) halyard tension on the mainsail's 'boltrope' (the three strand rope inside the sleeve at the luff).
As a 'trial' with the gooseneck/downhaul in proper position on the mast .... follow the directions advice from: How to properly RAISE a woven dacron mainsail - SailboatOwners.com
BTW - the correctly 'luff-tensioned' tack angle for a mainsail on the B40 is 88 degrees, as measured from the top of the boom to the mast.
Such 'corrections' via proper raising of the mainsail with 'proper' luff tension will also tend to remove/alleviate 'weather helm' if your boat is at near proper mast rake as with more tension on the 'boltrope'/luff, the point of where the maximum draft in the mainsail occurs .... will move 'forward', and the clew will move 'up' taking the boom aft end with it.
hope this helps.
edit/add: From the 'databook', The typical amount of boltrope 'preload' for a B40 with a mainsail luff @ 39.5ft. is: to raise the mainsail to 'just' full up ... and then: 'crank on' an additional four+ inches
halyard 'stretch' ... that four inches will be correspond to the aft end of the boom raising (as a reaction to the luff now stretching out by 4 inches) by that same 4+ inches
... & the sail will now be closer to its 'as designed' shape, will be more 'draft forward', its leech will be 'straighter' (more 'open') and not 'hooking up to windward', the sail will have less 'overall' draft (less 'baggy'), etc.; the boat will less aggressively heel over, will be faster, less 'cranky', and the helm pressure will become 'more neutral'.
If you cant get that 4+ inches additional 'stretch' to get the tack angle to ~88° when fully raised and fully tensioned, then the boltrope needs to be 'eased' or replaced by a sailmaker, etc.
Ill give you 10:1 odds that this is a SAIL problem ... happens to old dacron mainsails when the luff boltrope eventually and predictably 'shrinks' due to age.