Those devices are likely quite different in some respects, for example memory sizes, pinouts, clocks/cycle, etc. You really need to compare the datasheets of the two devices, find the differences then consider how they might affect your program. From there you can start debugging to see where your program stops working.
Use the verify feature in Flash Magic to check that the hex file was programmed correctly.