Final comment for a while. It looks like one can use lightweight-hotspots collection, however, this requires the kernel modules to be installed which, of course, they are not. I am guessing all the target-pid collectors require this module. I have put in a help ticket on our big iron system, however, they tend not to address these sorts of issues.
The attach-to-process (-target-pid) functionality on Linux was added in Update 3. Also, the command to perform the attach doesn't return until the target process finishes - you would need to use fork/exec rather than 'system' to perform a self-attach.
When running the original command you listed ('srun -n 1 amplxe-cl -collect hotspots -r r002hs myapp') - did it produce the result directory? If so, look in the data.0 subdirectory for error messages. If present, that may give some indication why your application is failing to run.
Note that the issue may not be just running under Slurm, but some issue with any of the technologies involved. (Slurm -> MPI -> Linux node )