Try piping the metrics to "promtool check metrics", e.g.
curl localhost:8080/actuator/prometheus | /path/to/promtool check metrics
You may get a better description of the error. If that doesn't help, then load the metrics to a file and do a binary chop.
i.e. run the first half through promtool check metrics, then the second half, and see which half has an error; repeat with ever smaller pieces.
Note also that metric names are not allowed to contain dots. See:
/opt/prometheus/promtool check metrics <<EOS
# HELP custom_jvm.threads.states The current number of threads
# TYPE custom_jvm.threads.states gauge
custom_jvm.threads.states{region="us-east-1",state="timed-waiting",} 2.0
EOS
error while linting: text format parsing error in line 1: invalid metric name in comment