How to access custom properties from python
You just need to remove the dot, so the correct invocation is:

bpy.data.objects["Cube"]["prop"]


Python's subscription syntax doesn't use dot character.

Note: In Python terminology this is known as getitem rather then getattr access.