Here are two examples with using an Ad-Hoc network, which I verified they are working on two devices connected with each other.
First one is with static IP (you need to change 192.168.2.1 to 192.168.2.2 on the second device):
[connection]
id=Ad-Hoc
uuid=291b2424-9f8c-3d32-bae0-fd5e2c831e68
type=802-11-wireless
[802-11-wireless]
ssid=Ad-Hoc
mode=adhoc
[ipv4]
method=manual
address1=192.168.2.1/24,0.0.0.0
[ipv6]
method=ignore
After this you may ping both of those devices from each other.
Another way is with a local-link method:
[connection]
id=Ad-Hoc
uuid=291b2424-9f8c-3d32-bae0-fd5e2c831e68
type=802-11-wireless
[802-11-wireless]
ssid=Ad-Hoc
mode=adhoc
[ipv4]
method=link-local
[ipv6]
method=ignore
You may also use method=auto
on one of the devices, but then you will need to run a DHCP service (e.g. dnsmasq) on the other device, so that IP addresses are assigned.