Are you doing this in a page, or did you inherit from the CMSAbstractWebPart class for the control? What is sounds like is your code is trying to do this after the form has already rendered.
I would go into the CMSWebParts directory and check out the form control and see the lifecycle of it. Typically the form set-up is done during the SetupControl() function (which gets called from the OnContentLoad). This happens pre-page render.
If you are not using the CMSAbstractWebPart and want to do this in a ASPX page, I would try moving your code to the Page_Init function, so you are settings these values pre-page render. I have not tried that, but I suspect that would help. In your instance I think you code is trying to override settings that already are set.
Hope that helps