Issues with Shiny code can stem from both the reactive Shiny code itself or the regular R code used in the functions. In order for us to help you with your question, please provide us a minimal reprocudible example (Reprex) where you provide a minimal (dummy) dataset and code that can recreate the issue. One we have that, we can go from there. For help on creating a Reprex, see this guide:
Also, could you elaborate on point 2 where you show the diagram. What action or flow is it supposed to represent? Again, providing a reprex will give the best chance of us being able to help you.