It seems, for whatever reason, that your camera can not detect when the flash signals a confirmation that is is charged and ready to take a shot. This may be an issue with the confirmation circuitry, or it may be an actual issue with the flash itself that prevents the capacitors in it from charging or otherwise prevents the flash from functioning properly.
You could send the camera in for service to see if the problem can be diagnosed and corrected. Unless your D3400 is still under warranty, the cost of the repair will likely be an appreciable percentage of the price you paid for the camera. It may even exceed the value of a used D3400.
If you don't want to spend the money on getting your D3400 repaired, an easy solution is to buy an external flash. Third party flashes with full i-TTL capability ("Auto" flash), almost certainly more power, and sometimes additional features than the D3400's internal flash offered are available for as little as around $100 in the U.S. Manual only controlled flashes can be as little as half that. Even the compact Nikon SB-300 runs less than $150 and would be a considerable upgrade to the built-in flash.
Before you buy a flash, though, you might want to borrow or rent one to confirm that the issue is not deeper in your camera's control system than just the built-in flash unit. Even a very cheap manual flash should confirm that the camera's hot shoe is working and can fire a flash. There is the very remote possibility that your camera could fire a single pin manual flash but not fire a TTL flash with the additional pins in the hot shoe connection, but the chances of that are very slim.