Sharing folder between Host and Container : doesn't work via a Profile

If I add the appropriate comments as config items, after the container is created, then the sharing between Container and Host works fine.
$lxc config device add u5 home disk source=/home/john/shared path=/home/jradxl5/shared
$printf “uid $(id -u) 1005\ngid $(id -g) 1005” | lxc config set u5 raw.idmap
$ lxc restart u5
Remapping container filesystem

if I try to add the entries into a Profile, then cloud-init carries out it’s tasks in an inconvenient order, and it does not work. (i.e, the myshared1 path is created as root) Here is an excerpt of the Profile (formating ignored)
$lxc profile show profile4

security.idmap.isolated: “true”

user.user-data: |
- default
- name: jradxl1
gecos: Jradxl1
groups: sudo
shell: /bin/bash

list: |
expire: false

raw.idmap: |-
both 1000 1001

path: /home/jradxl1/shared
source: /home/john/shared
type: disk

Am I doing anything wrong?
Is there a better method?

lxd version 3.7, snap version

I think your problem might be that your container mount point might not exist when first trying to attach the device.