How are you capturing the game?
I remember on an old Windows XP system, when that was still current, that my video screen recorder wouldn't capture a framed YouTube video. It would capture everything else, but inside the frame would be solid black. I think the display system worked like that on purpose, mostly for technical reasons, considering the average performance of things at the time:
WinXP would draw everything else, which was mostly static, and thus be able to capture it. And then it passed the video data directly to the graphics card and told it to draw directly on the screen in "this position", which overwrote the solid black that Windows put there. The result was correct on the physical screen, but a capture point in the middle of the process of course didn't get it all.
The mouse overlay must have been a separate thing then, added at the end of the process, in both the GPU and the capture program separately.
Things work a little bit differently today, but some similarities may still exist.