Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
Why are you ignoring the simple request to share a link to your repository? It is not possible to help you when only seeing three lines of code out of context.
sound more like a bug in your config,
shortcode call or just a migration issue.
you pass an absolute url and try to get that page. supposedly it’s not there.
already suggested: code defensive and use an else clause with the with statement. print out the values, check if the paths are correct…
check your configs permalinks etc. read the recent doks on the features you use in your setup and implementation.
117 is quite ancient nd you have mixed code in your sources now…
already stated: guessing around does not make sense (ok one guess baseURL changed to a subfolder)
if you can’t share your repo just create a small reproducible exmple with all involved components.