When using iCloud Photos, the key thing to note is this: With Optimize Storage ON, smaller, space-saving photos and videos are kept on your device while all of your original, full-resolution versions are stored in iCloud.
So, if you want to access the photo on your iPhone, you will have to wait while a full-size-original-resolution of the said image downloads. The wait time will depend on your network speed and traffic to iCloud, etc. This is usually a few seconds.
If you do not wish to "wait", then you can turn OFF Optimize iPhone Storage by selecting the other option: Download and Keep Originals
This will cause all your photos to stay on your device (iPhone) in their original resolution. When you go to view an image, it will not have to download from iCloud. Also, this will cause more of your iPhone Storage to be used (to save the full-size-original-resolution photos, etc.), so you will run out of device storage sooner.
Hope this clears up the confusion!
Manage your photo and video storage - Apple Support