Yes it can cause this much trouble, and yes it will clear up. Your doctor is giving you good advice and a good medication. It shouldn't take too long.
But there is another possibility to consider. Being forty, and having an arthritic condition, may have set off some midlife fears. If so, some short term counseling would be useful.