I don't know why a dermatologist would say that it's not a fungal infection, as that looks and sounds very much like balanitis to me, and it's quite common for that to appear and disappear. The wrinkling on two of the pics you posted on other discussions looks unusual, but not the redness.
If it's fungal, then taking antibiotics won't help, and could easily make things worse. I'm appending my standard cut and paste for balanitis, though since it doesn't seem to have been responding to antifungals, I'd see a urologist.
--
If it's balanitis, then these links may help, though the second article is written for doctors:
https://patient.info/health/balanitis-leaflet
https://patient.info/doctor/balanitis-pro ;
Washing (with water, no soap) daily, and taking a leak and washing after masturbation or sex will probably help, and you could also try Canesten cream or Daktarin cream. Loose fitting cotton underwear may help, and some sites recommend washing underwear with non-biological washing powder or liquid.
(Canesten is also known as Clotrimazole, and Daktarin is also known as Miconazole or these brand names: Desenex and Zeasorb in US and Canada, Micatin, Monistat-Derm, Daktarin in India, UK, Australia, Belgium and the Philippines, Daktar in Norway, Fungidal in Bangladesh, Decocort in Malaysia.)