I thought Shift+Alt+G (Remove Selected from Active Collection) was just a change to a collection.
I read the official manual and understood it.
But in fact, the way this function works in the blender is not only removing the selected objects from the collection to which the active object belong, but also the active object.
Please check the GIF.
The result I expected was as follows.
Additional Question
If so, how to check the active collection in Blender UI?
When checked with bpy.context.view_layer.active_layer_collection.name
, the last clicked collection in the outliner is displayed.
This will also be displayed in the top left of the 3D viewport.
However, the active collection that the collection allocation operations mean seems to mean the collection to which the last selected active object belongs, not the last selected collection in the outliner.
I am curious how to check this active collection in UI.
Solution:
Ah, this was simple and basic.
To easily check the list of active collections to be used in the collection assignment operation, check the property editor\Object tab\Collections panel
.