A man who identified as ‘evil Jesus’ while plotting to kill a prosecutor on the dark web has been detained indefinitely.