Aaron Carter's plan to buy a gun got thwarted by a computer.
As we reported ... a 911 caller told cops Aaron tried to buy a gun but got turned down. We spoke to the manager at the Florida gun shop, who says the singer was automatically denied after his background check got flagged. It's unclear what triggered the alarm.
The staff also noticed Aaron's odd behavior -- he was jumpy, bragging about himself and hitting on girls at the shop. The manager said he appeared unhinged.