Capacitor custom plugin to get latest photo

I am having a problem getting the latest photo from iOS, I followed this tutorial

https://www.joshmorony.com/running-custom-native-ios-code-in-ionic-with-capacitor/ exactly.

Problem is, if I install my app into a new simulator or device, it asks for permission. When I allow it then it loads the latest photo from the library (works as expected). But if I try to get photo on the same device it does nothing (Device that already has permission). No error shown on the console.

Any Help please I’m stuck on it. I want this plugin to get the last 10 photos from the library.

Thanks.