Tapping buttons located outside of Appium's get_window_rect()

I am trying to figure out a solution for a problem;
I know Appium’s get_window_rect() reports the viewport size and not the actual full screen resolution of the device. For example, it will return 2125x1080 on a device using a 2400x1080 resolution. iirc this is because get_window_rect excludes the buttons and status bars.

We have made our own library using cv2 to do image matching inside game apps (full native). We take a screenshot somewhere in the game, look for a button with image template and report its center points (x, y) so we can tap it.

My issue is that sometimes the button found is really close to the edges of the screen and the center point will actually be outside of the values reported by get_window_rect. So the tap fails with an exception since I will try tapping at (2200, 955) or something. Does anyone know how I can workarround this?