AMC7135 always regulating to 30mA
Attempting to apply voltage to OUT while switching VDD is extremely likely to put the internal control electronics into either a nonsensical or lockout state, and the switch ought to go between the load and the regulator.
You have two options:

Use a MOSFET as the switch (e.g. an nFET on the low side as shown below, with a microcontroller driving the gate). The microcontroller will not get &quot;fried&quot;; this is a standard way of switching a load whose current or voltage are too large for the microcontroller's I/O pins.



select a different current regulator with an enable input.

Note further that I've redrawn your schematic right-side-up. Putting ground on top and positive supply on the bottom is confusing.