I was finally able to reproduce your problem. I’ve dissected the last few series of steps in your process:

The program should probably not let a group be assigned to itself. I will write a separate bug report about that.
In general, though, you have created an extremely unconventional chart of accounts that promises future headaches. While some of the steps you described did not produce problems in the example sequence, they might well in the future with other transactions. I suggest consulting with a qualified accountant to design an appropriate chart of accounts.
As for getting Accounts payable back, I don’t know if that’s possible. The data is still there. If you go to the Suppliers tab, you should see an Accounts Payable balance for FRED. If you click on that, you can drill down to the purchase invoice you entered. The question is how to reverse assignment of the Accounts Payable group to itself, since the group is no longer visible for editing.
One possibility is to restore a backup from before you took that last step, if you have one. You would then need to re-enter all transactions after that backup was made.
I will invite the developer into this topic. He may communicate with you on ways to recover Accounts payable.