I think it’s mostly just the json tree being overzealous with the warning, actually. From what I can tell, the type is preserved as a string pretty well throughout. If you don’t care about the warnings in the editor, it’s probably reasonably safe to ignore…although I would still consider if there’s a different way to do things.
For instance, I set up a simple transform to return a dictionary with numeric strings as keys, and tested the type: