Hello,
Welcome to our Microsoft Q&A platform!
Hello, this is a problem caused by Shadow. If your minimum target version is 1903 or higher, you could use the following code to turn off the default shadow:
<Button.Flyout>
<Flyout>
<Flyout.FlyoutPresenterStyle>
<Style TargetType="FlyoutPresenter">
<Setter Property="IsDefaultShadowEnabled" Value="False"/>
</Style>
</Flyout.FlyoutPresenterStyle>
<Grid Width="400" Height="50" Background="Red"/>
</Flyout>
</Button.Flyout>
Thanks.