Get_list is not working properly when used in whitelist method

I am customizing HR PWA app, so i added a page where user clocks-in and clocks-out and when user clocks-in then the vue component calls a whitelist method which calls another function to know the number of existing attendance records of the employee for current date but that function is returning 0 records

output in logs

but when same function is executed from bench via bench execute command then it is returning the correct number of attendance records of the employee who clocked-in for current date

why same get_list() is not giving perfect output when called from a whitelist method?

@Vinay1 check date is coming in proper format or not

hey @Jeel,
in both cases, today date is taken from frappe.utils.today(), so there will be no issues regarding format or datatype
anyway I checked the format and datatypes are same in both cases

@Vinay1 get_list applies the appropriate permission rules when called from the console, set the same user that you’re testing in the PWA. This will make debugging easier.

You can set the user using the following Frappe function: " frappe.set_user(“bhavesh@nesscale.com”)"

@Vinay1
use getdate for attenace date in line 219

from frappe.utils import getdate
attendance_date: getdate(current_date)