what you're suggesting can only be done through the UI. My problem, I want to change dynamically.
and I have tested the block that causes the problem in multiple ways and it always result with the same exception
Your dynamic is the startValue, I believe this is where the exception is coming from. Check that this is coming through when the screen is initialised (set a default e.g. "Center" if there is no startValue value)