Why is the getBoundingClientRect value different in different browsers?

I have a function where I take its parameters from an element via getBoundingClientRect.

I tried to look through window.pageXOffset if I added it, I also added setTimeout to no avail.
Edge browser and Chrome have different values ​​for the same extension.
How can I correct this? or how to find the correct values ​​for letft and top?