What are you trying to achieve, OP? As far as I understand you want to use Nextcloud to sync your photos and then want to use Immich to view them?
Because if that’s the case, it doesn’t make the most sense currently. Immich currently isn’t a full featured photo library manager, but rather a tool to back up photos from your phone and smartly display those. It’s currently not geared toward at displaying existing photo libraries.
A number of other applications (PhotoPrism, Photoview, LibrePhotos, Piwigo) are better suited to do that, although it is planned for Immich if I understood correctly.