Opps

will I harm a diesel engine with 3 qts of 5w-40 oil mixed with 2 qts of hydraulic oil in the crank case ?

Hydraulic oil is not formulated for engines. I’d drain out all the contaiminated mixed oil and refill new diesel engine motor oil.

Diesel or not, hydraulic oil is not suitable as an engine oil. If it has not been in there long, likely little or no damage, but I certainly would not leave it there.

Did you accidentally do this??? Don’t make another move; drain everything and refill with proper diesel angine oil. Hydraulic fluid has TOTALLY DIFFERENT qualities, it is designed to TRANSMIT POWER, and lubricate as well in the process. Hydraulic systems do not have to cope with combustion gasses, and very high temperatures.