Problem in restoring apps

I have tried to run backup script with
ynh_backup "$final_path" "$final_path" and with ynh_backup "$final_path"
and
tried running restore script with:
ynh_restore_file "$final_path" "$final_path" and ynh_restore_file "$final_path"
But I get the same error.
As suggested by @JimboJoe
I created the mount folder by archivemount from the .tar.gz file and tried coping the files from mounted folder to the desired location and it was successful.
I am running YunoHost version 2.6 and backup have been created with YunoHost version 2.6 too

Edit: The problem is not there when restoring without archivemount.