inserting ports into a Modelica Custom Component is absolutely not well-supported in MapleSim, in my opinion. I go the following way to use Modelica Custom Components in MapleSim. I create my Modelica Components with the ports in OpenModelica. This is relatively easy, as the editor in OpenModelica is also more user-friendly. OpenModelica is free and an independent simulation tool.
Then I copy the code into the MapleSim component "Modelica Custom Component". However, this has the disadvantage that the ports placed in the icon move. This can be corrected manually in the annotation. If the ports and the first version of your model are included correctly, the Modelica model can be tested, further developed and optimized. If you use OpenModelica, you have to consider that MapleSim does not support Modelica version 4.0.0. In the settings in OpenModelica, you should use version 3.2.3. The second possibility is to insert a custom component via the menu "Add Apps or Templates". Ports are then also generated via a Maple worksheet. However, Modelica cannot be coded directly. Overall, Modelica coding is unfortunately not well-supported. Good luck.