Ng2-pdf-viewer not working offline

In ionic 6, ng2-pdf-viewer is not displaying pdf when internet is turned off, while works when internet is on.

Below is the code generated when phone is offline and online.

<!-- Online -->
<pdf-viewer _ngcontent-xjx-c126 clientsize="100%" style="display: inline-block; width: 100%; margin-left: 0px;" _nghost-xjx-c123>
    <div _ngcontent-xjx-c123 class="ng2-pdf-viewer-container">
        <div _ngcontent-xjx-c123 class="pdfViewer removePageBorders">
            <div class="page" data-page-number="1" data-loaded="true" style="width: 396px; height: 561px;">…</div>
            <div class="page" data-page-number="2" data-loaded="true" style="width: 396px; height: 561px;">…</div>
            .
            .
            .
        </div>
    </div>
</pdf-viewer>
<!-- Offline -->
<pdf-viewer _ngcontent-xjx-c126 clientsize="100%" style="display: inline-block; width: 100%; margin-left: 0px;" _nghost-xjx-c123>
    <div _ngcontent-xjx-c123 class="ng2-pdf-viewer-container">
        <div _ngcontent-xjx-c123 class="pdfViewer removePageBorders"></div>
    </div>
</pdf-viewer>

Below is the link of the file given to pdf-viewer in both connection modes.
src: http://localhost/_app_file_/data/user/0/io.app.myapp/files/My_PDF_File.pdf

Package info:
"ng2-pdf-viewer": "^6.0.0"