I am going to take a wild guess and say that the security light was on steady before you decided to change the battery. I am also going to guess that it had been on for a while and you never looked into why it was on because the vehicle was starting an driving just fine.
What likely happened is there was a problem with the ant-theft system. The problem was likely minor and the system went into a limp mode of sorts allowing you to continue to drive and start the vehicle with no issues.
the problem with these limp modes is if the battery is disconnected the system shuts the vehicle down as no longer remembers that the previous problem happened when the vehicle was being operated normally. The system now thinks the vehicle is being stolen and is shutting down the vehicle.
You best bet is to tow it to a reputable shop that has experience with these systems to have the problem diagnosed, repaired and relearn the anti theft system.
I’m happy to assist further over the phone at https://www.6ya.com/expert/jeremy_d728a59f986299fa