Ni() function not working on KWGT, but works on KLWP

I'm trying to make a widget with KWGT that shows the number of unread notifications, so I use the "ni" function. However it always gives 0, doesn't matter how many notifications I have.

When I use the same function within KLWP it shows the correct number.

Ps: I have granted notification access to both apps.

This is strange, should work just fine, can you try to reboot your device once?

I tried already and it worked after reboot, but later the problem appeared again.