This is an known issue on the repo: GradientBrushes are not supported on Shape.Stroke. You can follow up it on the github.
In addtion, according to the pull request: Added a support for GradientBrushes on Shape.Stroke: this is still not fixed on the windows platform.