queryTagHistory Getting Wrong Values

Hi, I'm trying to get a dataset with values from a historical tag using queryTagHistory(). The concept is that once the user selected the two dates (range), and then click on "Get Data", the data will be displayed on the table. The problem is that the values on the "first shift efficiency" column are wrong. In the example bellow you can see that the value at 1/28/2023 1:00pm should be 40.44 but the dataset has 47.66 instead.

Comparing values with chart.

Script in the button.

Tag history settings:

Are the values misaligned? I've seen similar posts in the forum before.

Correct, the values are misaligned by one. A bug?

Seems to be. When I first encountered somebody talking about this in the forum, I set up an experiment, and I found that I was able to independently replicate the problem. I'm not sure if anybody got around to reporting it or if IA has any kind of ticket open on this problem, but since nobody has responded as such, the proper course of action would be to get official support involved, and it would be great if you could report back what you find out from them for future reference in the forum.