2004 rubicon with 2006 engine

My friend told me that nothing ever goes wrong with these so I saw one at an auction and bought it. What I learned after getting it home is that when you get to about 25mph the ‘dash’ starts blinking and it will not shift correctly. After research blink counter said it was the speed sensor and I set about finding it to test and / or replace. It is not where it should be, in fact it doesn;t exist at all on this machine. What I think I figured out is that it is a 2006 engine in a 2004 frame. I can;t find the serial number of the engine but I did on the frame. The other thing is that the fwd does not work and I discovered that they ground the spline off the front engine shaft so that the drive shaft "fits" but it obviously doesn’t do anything. Trying to decide the best way out of this, sell for parts? the engine starts and runs or look for a front axle shaft because I think the speed sensor is on the front differential in a 2006 but who knows if the output would work with the 2004 engine control or it would mount in the frame. I could maybe find a 2004 engine and sell the one I have. I think I bought it for $2500 which seemed like a deal and know I know why, these guys were sneaky. Any suggestions appreciated!
Thanks