You did nothing wrong here. This message pops when using custom visuals in your reports ever since the custom visuals sandboxing feature was introduced. It even pops when importing only the DevTools sample "YourVisual" visual to the report. The only exceptions are custom visuals from the official gallery, since they are reviewed by Microsoft and are therefore not sandboxed.
So if your visual is not functioning properly, this message is not an indication of what's causing it(But don't rule out the sandboxing feature itself as the cause).