Why is the captured window outlined with a yellow border?

The UE5.x version of WindowCapture2D uses the WinRT capture functionality. This is a native Windows feature, and when using it, a yellow border is displayed. Therefore, this is not a problem.