Perhaps you can use solutions for older nextcloud versions. I think you must change the code e.g. rewrites in .htaccess .
Read
SOLVED: Nextcloud 16 - How to allow iFrame usage
Embed Nextcloud 17 (ubuntu) as an iframe on a wordpress site
If iframes not work perhaps you like open a new tab for nextcloud (target="_blank")
https://www.w3schools.com/TAgs/tryit.asp?filename=tryhtml_link_target