If it is possible it might rather be more prudent to use identical flanges, Sch 80,on both ends, and make the following butt joint tapered as per code allowed detail.
Perhaps one of the WN flange Sch 40 might have been integral with some equipment to lead you to the fix. if not so, you may consider the approach cited above.
Best regards
Venugopal