Minalec, I'm so sorry that this is happening, but Noodles has hit everything I would have told you to do. Number one is going to be to take your bird to the vet, and make sure that it is only a certified avian vet, because unfortunately most exotic vets don't really have much education or training in birds or avian medicine. if you need help finding the closest certified avian vet to you we can help you with that. Your bird should have a full wellness exam every year at the latest, some people do it every 6 months. Because birds, all birds, possess a natural, innate survival instinct that causes them to hide all outward signs of illness and pain for as long as they possibly can, this means that most birds have been sick or injured for weeks to months by the time we people notice that something is wrong. For that reason any behavioral changes in your bird need to be taken seriously as possibly the only signal you have that something is wrong with your bird medically.
A full wellness exam should include a complete physical exam and visual exam, a full fecal smear, culture, and Gram stain, and then full routine blood work to check for infection, anemia, liver and kidney functions and overall health, as well as any metabolic or nutritional issues. Having this blood work done at least once a year, every year, will give you baseline levels when your bird is healthy to compared to if he happens to become sick. Hopefully your birds recent behavior changes are not due to illness or pain, but the first thing you need to do when this happens is to rule out any medical problems.
Once you rule out all possibilities of a medical issue, then you need to think about or mental behavior just as noodles pointed out. It makes no difference whether or not your bird is a male or a female, obviously hormones affect both genders just like they do in people. And yes, please remove the coconut from his cage immediately. That may be all it takes to change his behavior back to normal, you just don't know. The bottom line with birds, captive and pet birds anyway, is that they should have no nesting material at all inside of their cages, and this includes any types of bedding, wood chips, shredded paper, or anything similar to the above, nor should they have any types of towels or blankets inside of their cages. Basically nothing that could be taken as being nesting material... In addition, and even more important for male birds rather than female birds, and I speak from personal experience with a green cheek conure who is a male on this one, is that they have no small, dark places that they can get inside or underneath. This causes a male birds hormones to go absolutely insane...And the thing is that your bird may have had these things inside of its cage for a very long time without having any issues at all, possibly even four years and years with no issues at all, and then one day performance just decide to go nuts on them! We just had a member who's 7 year-old female Sun Conure became hormonal for the very first time in her life and became egg bound, I nearly died with the only thing saving her being emergency surgery to open up her abdomen and remove the egg. Her bird almost died from egg binding at 7 years old, and she had never once laid an egg prior to this. She has since removed the bird's "Snuggle/Happy" Hut from her cage permanently so that this never happens again. I'm not exactly what you need to do is to remove any and all bedding and small, dark places got your bird can get inside of or underneath. This includes the coconut with the hole in it as well as any other small boxes, tents, hammocks, "Huts", etc. I would do this immediately regardless of whether it's the cause of his current behavioral change... It's just what is safest and best for his overall health.
And not to disrespect Laura and anyway because I value her opinion and advise, but it really makes absolutely no difference how old your bird is or how long they've lived with no issues from any types of bedding, nesting material, or any types of beds or sleeping boxes, because it can happen at any time, whether they are one-year-old or 20 years old. And our member Sunny, who I just spoke about, is the perfect example of this...7 years old and nearly died due to her hormones finally going nuts and causing Follicles and Eggs to form for the very first time...It only takes once to cause issues. And with male birds they obviously aren't going to be afflicted with follicles or eggs forming, but instead hormonall behavior in male birds is typically expressed in the form of aggression, timidness, and just very strange and unusual behavior that you've never seen them do before, such as sudden fear or anxiety.
And just to make a point, parrots do not need a bed to sleep in, and when you remove the coconut from your bird's cage, he will simply go to a perch and sleep on the perch. He will probably look around for the coconut, but it's not going to be a big deal. We as people tend to "humanize" our pet birds/parrots, simply because we love them, and sometimes the things that we do to them and the things that we provide them with are actually very dangerous, unhealthy, and often cause behavioral changes in them that are unwanted.
I would say that the first thing you need to do is to find the closest certified avian vet to you and make an appointment for a full wellness exam, and be sure to tell them over the phone that you wanted to include complete blood work and fecal testing. And this is the other reason you want it to be only a certified avian vet, because you need to discuss the behavioral changes that your bird has recently displayed and they can help you out with this as well, because they understand changes in birds such as hormonal changes, environmental changes, etc. Hopefully the blood work and everything else from the physical and medical exam will be normal, and then that will narrow down the possibilities of what is causing the behaviors... Removing the Coconut and any other bedding or nesting material, any and all boxes, tents, "Huts", etc. and putting him on a strict " Natural Light Schedule" will rule-out or confirm hormones as the cause...Then it's narrowed down to something in his environment...