Every outboard I have ever worked on has a clockwise rotating engine - so the pinion gear driving the prop shaft is rotating clockwise (and is cut as such).
Some smaller horsepower models that were either (direct drive - always in forward) or only had forward/neutral, including the modern Honda's that use a centrifigal clutch) end up being "counter-rotating" at the prop, since the prop shaft will (naturally) turn in the opposite direction of the pinion (with the minimum number of gears in the case) - however, again, the pinion is rotating clockwise and is cut that way.
The pinion and the forward gear are cut as a matched set in outboards - with the pinion running clockwise, and the forward gear is driven clockwise as is the reverse gear, which also rotates "clockwise". The propshaft direction is determined by the location of the forward gear in relation to the pinion. Forward of the pinion = clockwise or "normal" rotation, behind the pinion = counter-clockwise or counter rotation or left hand rotation. (all propshaft directions - the powerhead still turns clockwise no matter what)
Additionally, there is clutch in the gearcase- so even if you attempted to run the gears (backwards) the propshaft clutch would slip preventing the propshaft from turning.
So while you may be able to use the gearcase, I suspect you would have to get custom machined gears that would work "backwards", because I am certain you would destroy "normal" gears in short order if you tried to force them to work backwards (even if you overcame the clutch issue) - they just aren't cut to allow for that to happen for very long. They are hypoid cut for clockwise rotation (pinion and forward and reverse).
The other issue I can forsee (assuming you could over come the above issues) is having way too much "gear" for a diesel engine. Outboard gears in the 40 horse class of Yamaha are typically in the 1.8:1 range.
(of course, with custom gears you could re-jig that)
With a powerhead w.o.t. (wide open throttle) range of 4500-5500 rpms (5250 would be optimal) on a typical Yami 40 horse, that would give you a propshaft rpm of about 2900 rpms.
I suspect your diesel is turning significantly lower rpms wide open (like maybe mid/high 3K range?).
Since the maximum prop diameter is restricted by the cavitation plate on the lower unit (and to a lesser extent, the pitch is restricted to an upper range that would be suitable for a given diameter for a 40 horse outboard), unless you opted for a custom prop, you might not get "enough propeller" to get any real performance out of the engine. I would think you would require gearing in the 1.0 to 1.2:1 range (and turn a larger diameter prop than the case would allow for)in order to get the lower unit to perform like it had a gas engine up top.
So that's kinda my thoughts initially...
Yes, Plywood is "real" wood
A "professional" is someone who gets paid for their work - it doesn't necessarily mean they are good at it