Repository: godot
Issue: Calling set_process_internal(true) upon the timer node that exists within the popup menu of a TextEdit node crashes the project window.
Labels: bug,crash,topic:gui

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
3.2.3


**OS/device including version:**
windows 10, v 1803


**Issue description:**
so i was using this script to pause my menus in the background:
```gdscript
#(Un)pauses a single node
func set_pause_node(node : Node, pause : bool):
	
	node.set_block_signals(pause)
	node.set_process_input(!pause)
	node.set_process_internal(!pause)
	node.set_process_unhandled_input(!pause)
	node.set_process_unhandled_key_input(!pause)

#(Un)pauses a scene
#Ignored childs is an optional argument, that contains the path of nodes whose state must not be altered by the function
func set_pause_scene(rootNode : Node, pause : bool, ignoredChilds : PoolStringArray = [null], indent : int = 0):
	
	if !pause:
		var istr = ""
		var i = 0
		while i < indent:
			istr += "	"
			i+=1
		print(istr + str(rootNode.get_class()))
		
	set_pause_node(rootNode, pause)
	for node in rootNode.get_children():
		if not (String(node.get_path()) in ignoredChilds):
			set_pause_scene(node, pause, ignoredChilds,indent +1)
```
Because having to go through all of my scenes and nodes to choose which nodes i do not want to pause using the `pause_mode` property is a lot more work to implement.

Anyways i discovered that this would crash the project window and print this error whenever it looped over a `TextEdit` node:
```
ERROR: get: FATAL: Index p_index = -1 is out of bounds (size() = 9).
   At: ./core/cowdata.h:152

=================================================================
        Native Crash Reporting
=================================================================
Got a SIGILL while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

=================================================================
        Managed Stacktrace:
=================================================================
```
I wasn't even aware that certain nodes are actually comprised of other children nodes until now.

**Steps to reproduce:**
I narrowed it down to this though the issue seems to stem deeper beyond my understanding of the engine:

1) create a 2D scene with a `TextEdit` node.

2) run this code in` _ready()`
```gdscript
       var crashy_nodes = get_node("TextEdit").get_children() 
	
	for node in crashy_nodes:
		print(node)
		#within the popup menu child of the textedit node
		if node is PopupMenu:
			for node2 in node.get_children():
				print(node2)
				#this crashes godot and gives  "ERROR: get: FATAL: Index p_index = -1 is out of bounds (size() = 9)."
				#though not immediately but the frame afterwards
				node2.set_process_internal(true)
```



**Minimal reproduction project:**
[Crash Test.zip](https://github.com/godotengine/godot/files/6241436/Crash.Test.zip)