Fedora 34 freezes after boot login or removing charger

Fedora 34 freezes sometimes after boot login with a grey screen. Then I have to shut down the laptop using the power button. I updated the system multiple times but the issue is not solved.
It also sometimes freezes after removing the charger. It happens mostly when the laptop is in the full-screen mode of some app. Anybody having similar issues? Is there any solution? My system info is as follows

System: Kernel: 5.14.10-200.fc34.x86_64 x86_64 bits: 64 compiler: gcc v: 2.35.2-6.fc34 Desktop: GNOME 40.4
Distro: Fedora release 34 (Thirty Four)
Machine: Type: Laptop System: Dell product: G5 5505 v: 1.8.0 serial: <filter>
Mobo: Dell model: 0JT83K v: A02 serial: <filter> UEFI: Dell v: 1.8.0 date: 06/30/2021
Battery: ID-1: BAT0 charge: 38.6 Wh (91.5%) condition: 42.2/51.0 Wh (82.7%) volts: 12.2 min: 11.4 model: BYD DELL M4GWP0C
status: Discharging
Memory: RAM: total: 14.99 GiB used: 7.81 GiB (52.1%)
RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU: Info: 8-Core model: AMD Ryzen 7 4800H with Radeon Graphics bits: 64 type: MT MCP arch: Zen 2 rev: 1 cache:
L2: 4 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 92620
Speed: 1397 MHz min/max: 1400/2900 MHz boost: enabled Core speeds (MHz): 1: 1397 2: 1398 3: 1397 4: 1397 5: 1397
6: 1397 7: 1397 8: 1397 9: 1397 10: 1397 11: 1397 12: 1397 13: 1397 14: 1397 15: 1397 16: 1397
Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] vendor: Dell
driver: amdgpu v: kernel bus-ID: 03:00.0
Device-2: Advanced Micro Devices [AMD/ATI] Renoir vendor: Dell driver: amdgpu v: kernel bus-ID: 07:00.0
Device-3: Realtek Integrated_Webcam_HD type: USB driver: uvcvideo bus-ID: 3-2:2
Display: wayland server: X.Org 1.21.1.2 compositor: gnome-shell driver: loaded: amdgpu,ati
unloaded: fbdev,modesetting,radeon,vesa resolution: 1920x1080~120Hz
OpenGL: renderer: AMD RENOIR (DRM 3.42.0 5.14.10-200.fc34.x86_64 LLVM 12.0.1) v: 4.6 Mesa 21.1.8 direct render: Yes
Audio: Device-1: Advanced Micro Devices [AMD/ATI] Navi 10 HDMI Audio vendor: Dell driver: snd_hda_intel v: kernel
bus-ID: 03:00.1
Device-2: Advanced Micro Devices [AMD/ATI] Renoir Radeon High Definition Audio vendor: Dell driver: snd_hda_intel
v: kernel bus-ID: 07:00.1
Device-3: Advanced Micro Devices [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor vendor: Dell
driver: snd_rn_pci_acp3x v: kernel bus-ID: 07:00.5
Device-4: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Dell driver: snd_hda_intel v: kernel
bus-ID: 07:00.6
Sound Server-1: ALSA v: k5.14.10-200.fc34.x86_64 running: yes
Sound Server-2: PipeWire v: 0.3.38 running: yes
Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Dell driver: r8169 v: kernel port: 2000
bus-ID: 05:00.0
IF: enp5s0 state: up speed: 100 Mbps duplex: full mac: <filter>
Device-2: Intel Wi-Fi 6 AX200 vendor: Rivet Networks Killerâ„¢ driver: iwlwifi v: kernel port: 2000 bus-ID: 06:00.0
IF: wlp6s0 state: up mac: <filter>
IF-ID-1: virbr0 state: down mac: <filter>
Drives: Local Storage: total: 476.94 GiB used: 142.7 GiB (29.9%)
ID-1: /dev/nvme0n1 vendor: SK Hynix model: BC511 NVMe 512GB size: 476.94 GiB temp: 57.9 C
Swap: ID-1: swap-1 type: zram size: 8 GiB used: 392.5 MiB (4.8%) dev: /dev/zram0
Info: Processes: 424 Uptime: 5h 32m Init: systemd runlevel: 5 Compilers: gcc: 11.2.1 Packages: 4 note: see --pkg
Shell: Bash v: 5.1.0 inxi: 3.3.06

Does it provide any useful info about the problem?

Just a quick guess related to disconnecting the charger. Many laptops are configured to switch to power saving mode when running on battery and what you are seeing as a freeze may possibly be the forced slowdown of the CPU in mode switching. Mine runs at ~4100 MHz when on the charger and at ~800 MHz on battery, or ~1/5 the speed. Yours shows a max speed of 2900 and min of 1400

CPU:       Info: 6-Core model: Intel Core i7-9750H bits: 64 type: MT MCP arch: Kaby Lake note: check rev: A cache: L1: 384 KiB 
           L2: 12 MiB L3: 12 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 62399 
           Speed: 4126 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 4126 2: 4193 3: 4148 4: 4208 5: 4144 6: 4202 7: 4091 
           8: 4196 9: 4196 10: 4192 11: 4194 12: 4160 

OK. The laptop hangs after that and I have to press the power button to shut down the laptop. Any solution?