Same issue here. Could it be that the .app is running at the time the chmod is performed? Installing the agent first without onboarding and then performing the enroll seems to work.
sudo ./elastic-agent install -f
sudo elastic-agent enroll --url= --enrollment-token=