Yes, the behaviour is expected. When you pass a dictionary to JavaScript, JavaScript receives a plane object which is a copy of the original dictionary.
The common use case is to send a python dictionaries to external JavaScript libraries that expect plain objects.