The main cause for errors in the function LocalizePanel is that the panel has changed from the time when the .lwl file was created in the localization utility. If, between the time when you load the panel, and when you localize it you, for example, create or discard controls, change their tab order, or add or remove elements in a ring control, you will probably get an error.
If you don't think you're changing the panel, try calling LoadLocalizedPanel, instead of LoadPanel/LocalizePanel. If the former works, but the latter doesn't, try taking out some of the code between LoadPanel and LocalizePanel, gradually, until you find the culprit.
Luis
NI