robotpy has an autonomous selector class that you can point at a directory of .py files and it'll setup a chooser that should work with SmartDashboard.
If you still want to roll your own, check out how it does it:
https://github.com/robotpy/robotpy-w...lector.py#L151. Your code looks correct though, maybe there's something else missing...
Additionally, with the latest version of pyfrc (as of a month ago or so?), there's an integrated chooser built into the simulator, using the key '/SmartDashboard/Autonomous Mode'. Run this sample for a cool demo of that working:
https://github.com/robotpy/robotpy-w...ful_autonomous