All medications have the potential to cause side effects or adverse effects. Although the selective serotonin re-uptake inhibitors (SSRI) tend to have a relatively low incidence of such problems, side effects do sometimes occur when patients take Prozac or other SSRI medications.
I am assuming that, like most patients, you are taking Prozac in the morning. If you are taking it later in the day, you may wish to discuss with your physician the possibility of shifting the dose to the morning. Many individuals who have sleep disturbance in relation to SSRI medication find that the problem resolves when they take their medication in the morning. Also, side effects may diminish when the dose of a medication is lowered. Again, this possibility should be discussed in detail with your prescribing physician. Sometimes the dosage of a medication can be lowered to the extent that side effects resolve while maintaining the desired therapeutic effect.
When patients and their physicians wish to lower the dose of a medication, but find that doing so results in break-through of symptoms, they may choose to utilize adjunctive therapeutic approaches in order to maintain the therapeutic effects despite a lower dose of the primary medication. These adjunctive approaches often involve other medications, but an equally important option - especially for obsessive-compulsive disorder (OCD) - would be psychotherapy. If you are not already receiving some form of psychotherapy, this again would be an important topic to discuss with your physician. Cognitive behavioral therapy (CBT), in particular, has been shown to be effective with respect to OCD. Many patients receiving such therapy find that they need far less medication than they did before they began CBT.
Finally, if the approaches mentioned above are not sufficiently helpful, your physician may choose to try you on an alternate SSRI medication. As you may know, there are many medications in this class, and Prozac is only one of them. Each of these medications - in any given patient - will have a slightly different therapeutic effect, and also a slightly different side effect profile. It is more than likely that you and your physician could find a SSRI medication that would result in fewer problems with insomnia; the difficulty is that such an alternative medication may not produce as robust a therapeutic effect as you describe for Prozac. As a result, the decision to switch to an alternative medication is a complex one - and, of course, one that should be discussed in great detail with your physician.